Skip to content

GitHub Actions on tags (#86) #3

GitHub Actions on tags (#86)

GitHub Actions on tags (#86) #3

Workflow file for this run

name: Deploy - Test Env.
on:
push:
tags:
- sprint-**-release-candidate
jobs:
PublishImages:
name: Publish Docker Images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login
run: |
echo ${{secrets.PAT}} | docker login ghcr.io -u ${{github.actor}} --password-stdin
- name: Build and Publish
run: |
docker compose build --pull
docker-compose push
- name: Logout
run: docker logout
DeployTestEnv:
needs: PublishImages
name: Deploy Image in the Test Environment
runs-on: ubuntu-latest
steps:
- name: Install SSH keys
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{secrets.TEST_ENV_SSH_PRIVATE_KEY}}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{secrets.TEST_ENV_SSH_HOST}} > ~/.ssh/known_hosts
- name: Connect and Pull
run: ssh ${{secrets.TEST_ENV_SSH_USER}}@${{secrets.TEST_ENV_SSH_HOST}} "cd /var/lib/bie && docker compose pull && docker compose up -d && exit"
- name: Cleanup
run: rm -rf ~/.ssh