Skip to content

Commit

Permalink
New release pipeline (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
NiJeTi authored Jan 2, 2025
1 parent 28b3093 commit c90caa7
Showing 1 changed file with 59 additions and 2 deletions.
61 changes: 59 additions & 2 deletions .github/workflows/build.yaml → .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: 'Build'
name: 'Release'

on:
push:
tags:
- 'v*.*.*'

env:
env:
MIGRATOR_IMAGE: 'ghcr.io/nijeti/cinema-keeper-migrator'
MIGRATOR_DOCKERFILE: 'build/migrator/Dockerfile'

Expand Down Expand Up @@ -84,3 +84,60 @@ jobs:
context: .
tags: ${{ steps.meta.outputs.tags }}
push: true

deploy:
runs-on: ubuntu-latest

needs:
- build-migrator
- build-service

environment:
name: prod

permissions:
contents: read
packages: read

steps:
- name: 'Checkout'
uses: actions/checkout@v4

- name: 'Calculate version'
run:
VERSION=${GITHUB_REF_NAME#v}
echo Deploying version $VERSION
echo 'VERSION=$VERSION' >> $GITHUB_ENV

- name: 'Login to container registry'
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
docker login \
-u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} \
ghcr.io
- name: 'Copy docker-compose.yaml'
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
source: docker-compose.yaml
target: ${{ secrets.PATH }}

- name: 'Run containers from docker-compose.yaml'
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
cd ${{ secrets.PATH }}
VERSION=$VERSION docker compose up -d

0 comments on commit c90caa7

Please sign in to comment.