test: host the real app via WebApplicationFactory for true integratio… #22
This file contains hidden or 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 image | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| paths: | |
| - "api/**" | |
| - "web/**" | |
| - "Dockerfile" | |
| - ".dockerignore" | |
| - ".github/workflows/build.yml" | |
| workflow_dispatch: | |
| workflow_call: | |
| inputs: | |
| version: | |
| description: "Release version to tag the image with (e.g. 0.0.1). Empty = :latest only." | |
| required: false | |
| type: string | |
| default: "" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| # :latest on every build; add the exact version tag only for release builds. | |
| - name: Compute image tags | |
| id: tags | |
| env: | |
| VERSION: ${{ inputs.version }} | |
| run: | | |
| tags="ghcr.io/chutch3/kenku:latest" | |
| if [ -n "$VERSION" ]; then | |
| tags="ghcr.io/chutch3/kenku:${VERSION},${tags}" | |
| fi | |
| echo "tags=${tags}" >> "$GITHUB_OUTPUT" | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3.7.0 | |
| - name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@v3.12.0 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push (UI + API in one image) | |
| uses: docker/build-push-action@v6.18.0 | |
| with: | |
| context: ./ | |
| file: ./Dockerfile | |
| platforms: linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/arm64,linux/arm/v7 | |
| pull: true | |
| push: true | |
| build-args: | | |
| VERSION=${{ inputs.version }} | |
| tags: ${{ steps.tags.outputs.tags }} |