Skip to content
Snippets Groups Projects
Commit d3bca7d0 authored by Fabian Nuraddin Alexander Gabel's avatar Fabian Nuraddin Alexander Gabel :speech_balloon:
Browse files

add jobs to gitlab-ci

parent 141c1e57
No related branches found
No related tags found
No related merge requests found
# This file is a template, and might need editing before it works on your project.
# Full project: https://gitlab.com/pages/plain-html
#
stages:
- build
- review
- deploy
# build standalone static webpage
build-standalone-static:
stage: build
allow_failure: false
image:
name: eltenedor/ubuntu-pandoc:latest
script:
- PROJECT_ROOT=`pwd`; export PROJECT_ROOT;
# build static webpage
- $PROJECT_ROOT/bin/build_standalone.sh
artifacts:
paths:
- public
rules:
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_BRANCH
# deploy static webpage on issue-branch to web-server hosted asteroids
deploy-on-asteroid:
stage: deploy
image:
name: alpine:latest
before_script:
## install dependencies
- apk update && apk add openssh-client bash #this command is for alpine
- eval $(ssh-agent -s)
- echo "$ASTEROID_SSH_KEY" | tr -d '\r' | ssh-add -
# See https://stackoverflow.com/a/57332478 about known hosts
- mkdir -p ~/.ssh && touch ~/.ssh/known_hosts
- echo "$ASTEROID_KNOWN_HOSTS" >> ~/.ssh/known_hosts
- chmod 700 ~/.ssh
script:
- mkdir .public-asteroid
- cp -r public/* .public-asteroid
- mv .public-asteroid public-asteroid
# deploy webpage on asteroid
- ssh $ASTEROID_USER@$ASTEROID_HOST "mkdir -p $ASTEROID_DEPLOY/$CI_COMMIT_REF_NAME"
- scp -v -r public-asteroid "$ASTEROID_USER@$ASTEROID_HOST:$ASTEROID_DEPLOY/$CI_COMMIT_REF_NAME/$CI_COMMIT_SHORT_SHA"
artifacts:
paths:
- public-asteroid
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment