Only run on amd64 #575
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & deploy server container (test) | |
on: | |
push: | |
branches: | |
- '*' | |
paths: | |
- .github/actions/docker-build-push/action.yml | |
- .github/actions/version/action.yml | |
- .github/workflows/build-deploy-on-push.yml | |
- server/** | |
workflow_dispatch: | |
concurrency: | |
group: docker-build-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
name: Build container | |
strategy: | |
matrix: | |
include: | |
- | |
container: server | |
tag: dev | |
- | |
container: server | |
tag: latest | |
- | |
container: nginx | |
tag: latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Get version | |
id: version | |
if: matrix.container == 'server' | |
uses: ./.github/actions/version | |
- | |
name: Build container (server) | |
uses: ./.github/actions/docker-build-push | |
if: matrix.container == 'server' | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
container: server | |
platforms: linux/amd64 # TODO: Delete me when merging | |
tag: ${{ matrix.tag }} | |
push: ${{ github.ref_name == 'main' && 'true' || 'false' }} | |
build-args: | | |
DEBUG=${{ matrix.tag == 'dev' && '1' || '0' }} | |
TOMATO_VERSION=${{ steps.version.outputs.version }} | |
- | |
name: Build container (nginx) | |
uses: ./.github/actions/docker-build-push | |
if: matrix.container == 'nginx' | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
container: nginx | |
context: server/nginx | |
platforms: linux/amd64 # TODO: Delete me when merging | |
push: ${{ github.ref_name == 'main' && 'true' || 'false' }} | |
tag: ${{ matrix.tag }} | |
deploy: | |
runs-on: ubuntu-22.04 | |
name: Deploy | |
if: github.ref_name == 'main' | |
needs: [build] | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Deploy containers | |
uses: appleboy/[email protected] | |
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 }} |