Commit b0647a04 authored by Andrew Okin's avatar Andrew Okin

Add job for deploying to test site

parent 07b31631
Pipeline #23 passed with stages
in 34 seconds
......@@ -8,25 +8,18 @@ cache:
paths:
- vendor
before_script:
# Ensure ssh-agent is installed
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
# Ensure rsync is installed
- 'which rsync || ( apt-get update -y && apt-get install rsync -y )'
- bundle install --path=vendor
build:
stage: build
before_script:
- bundle install --path=vendor
script:
- bundle exec jekyll build
- bundle exec jekyll build
artifacts:
paths:
- _site
- _site
deploy:
stage: deploy
dependencies:
- build
deploy_master:
extends: .deploy
only:
refs:
- master
......@@ -34,6 +27,32 @@ deploy:
name: production
url: https://forkk.net
script:
# Deploy the artifacts from the build stage
- rsync -a --delete _site/ "$SSH_DEPLOY_DEST"
deploy_test:
extends: .deploy
only:
refs:
- test
environment:
name: test
url: https://test.forkk.net
script:
# Deploy the artifacts from the build stage
- rsync -a --delete _site/ "$SSH_TEST_DEPLOY_DEST"
.deploy:
stage: deploy
dependencies:
- build
script: []
before_script:
# Ensure ssh-agent is installed
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
# Ensure rsync is installed
- 'which rsync || ( apt-get update -y && apt-get install rsync -y )'
# Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
......@@ -54,6 +73,3 @@ deploy:
- echo "$SSH_CONFIG" > ~/.ssh/config
- chmod 644 ~/.ssh/config
# Deploy the artifacts from the build stage
- rsync -a --delete _site/ "$SSH_DEPLOY_DEST"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment