trigger fork-image build #3
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: Fork Image Build | |
| # Fork-only workflow: builds a linux/amd64 swamp image from the current branch | |
| # and pushes it to ghcr.io/<owner>/swamp:<branch>-<sha> using the built-in | |
| # GITHUB_TOKEN. Not for upstream — the upstream Release workflow handles that | |
| # with signed multi-arch pushes to swampclub/swamp. | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches-ignore: [main] | |
| concurrency: | |
| group: fork-image-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.8.x | |
| - name: Version stamp | |
| id: version | |
| run: | | |
| # Keep the CalVer-ish shape the chart's tag regex expects. | |
| VERSION="$(date -u +%Y%m%d.%H%M%S).0-fork.$(git rev-parse --short=8 HEAD)" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Build dashboard | |
| working-directory: packages/dashboard | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Compile swamp (linux/amd64) | |
| run: | | |
| mkdir -p docker-build/linux-amd64 | |
| deno run -A scripts/compile.ts \ | |
| --version "${{ steps.version.outputs.version }}" \ | |
| --target x86_64-unknown-linux-gnu \ | |
| --output docker-build/linux-amd64/swamp | |
| cp Dockerfile docker-build/linux-amd64/ | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: docker-build/linux-amd64 | |
| platforms: linux/amd64 | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository_owner }}/swamp:${{ steps.version.outputs.version }} | |
| ghcr.io/${{ github.repository_owner }}/swamp:${{ github.ref_name }} | |
| build-args: | | |
| SWAMP_VERSION=${{ steps.version.outputs.version }} | |
| VCS_REF=${{ github.sha }} |