Skip to content

Build

Build #27

Workflow file for this run

name: Build
on:
workflow_run:
workflows: [Test]
types: [completed]
branches: [main]
jobs:
build:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- service: web
dockerfile: Dockerfile.web
- service: ssh
dockerfile: Dockerfile.ssh
- service: caddy
dockerfile: Dockerfile.caddy
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.workflow_run.head_sha }}
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v7
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: |
ghcr.io/cutalion/tic-tac-chec-${{ matrix.service }}:latest
ghcr.io/cutalion/tic-tac-chec-${{ matrix.service }}:${{ github.event.workflow_run.head_sha }}
cache-from: type=gha,scope=${{ matrix.service }}
cache-to: type=gha,mode=max,scope=${{ matrix.service }}