Skip to content
name: Build & deploy server container (test)
on:
push:
branches:
- main
paths:
- .github/actions/docker-build-push/action.yml
- .github/workflows/build-deploy-on-push.yml
- server/**
workflow_dispatch:
concurrency:
group: docker-build
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-22.04
name: Build container
strategy:
matrix:
tag: [dev, latest]
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set variables
shell: bash
run: |
echo "SHA_SHORT=$(git rev-parse --short=8 HEAD)" >> "$GITHUB_ENV"
-
name: Build container
uses: ./.github/actions/docker-build-push
with:
token: ${{ secrets.GITHUB_TOKEN }}
container: server
tag: ${{ matrix.tag }}
build-args: |
DEBUG=${{ matrix.tag == 'dev' && '1' || '0' }}
TOMATO_VERSION=${{ env.SHA_SHORT }}
deploy:
runs-on: ubuntu-22.04
name: Deploy
needs: [build]
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Deploy containers
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
port: ${{ secrets.SSH_PORT }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
fingerprint: ${{ secrets.SSH_FINGERPRINT }}
script: ${{ secrets.DEPLOY_TEST_SCRIPT_PATH }}