Skip to content

fix(ci): use correct Dockerfile(s) #33

fix(ci): use correct Dockerfile(s)

fix(ci): use correct Dockerfile(s) #33

Workflow file for this run

name: Push
on:
push:
branches:
- '*'
defaults:
run:
shell: bash -exuo pipefail {0}
jobs:
verify-format-and-code-generation:
name: Backend Code Format
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: backend/go.mod
cache-dependency-path: backend/go.sum
- run: make rest
- run: go fmt ./...
working-directory: backend
- run: git status --porcelain
backend-unit-tests:
name: Backend Unit Tests
runs-on: ubuntu-22.04
needs: verify-format-and-code-generation
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: backend/go.mod
cache-dependency-path: backend/go.sum
- run: go test ./...
working-directory: backend
docker:
name: Build ${{ matrix.image }} image
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
matrix:
images:
- { dir: backend, suffix: backend }
- { dir: backend, suffix: exchangeRatesJob }
- { dir: backend, suffix: initJob }
- { dir: frontend, suffix: frontend }
fail-fast: false
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- if: matrix.images.suffix == 'frontend'
run: |-
cat > frontend/apply-patches.sh <<PATCHES_EOF
${{ secrets.FRONTEND_PATCHES }}
PATCHES_EOF
- uses: docker/setup-buildx-action@v2
with:
install: true
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v4
with:
builder: ${{ steps.buildx.outputs.name }}
cache-from: type=gha,scope=${{ github.ref_name }}-${{ matrix.images.suffix }}
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-${{ matrix.images.suffix }}
context: ${{ matrix.images.dir }}
file: ${{ matrix.images.dir }}/Dockerfile.${{ matrix.images.suffix }}
push: true
tags: ghcr.io/${{ github.repository }}/${{ matrix.images.suffix }}:${{ github.sha }}