edit sidebar #25
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 & Push (GHCR) | |
| on: | |
| workflow_dispatch: {} | |
| push: | |
| branches: ["main"] | |
| paths: | |
| - "server/**" | |
| - "client/**" | |
| - "pyworker/**" | |
| - "docker-bake.hcl" | |
| - ".github/workflows/build.yml" | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to GHCR | |
| run: echo "${{ github.token }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - name: Setup QEMU (for multi-arch) | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: linux/amd64,linux/arm64 | |
| - name: Setup Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build & Push (latest + short-sha) | |
| if: github.ref == 'refs/heads/main' | |
| env: | |
| REGISTRY: ghcr.io/cornellev | |
| GIT_SHA: ${{ github.sha }} | |
| run: | | |
| SHORT="${GIT_SHA::7}" | |
| TAGS="latest,${SHORT}" | |
| REGISTRY="$REGISTRY" TAG="$TAGS" docker buildx bake \ | |
| -f docker-bake.hcl \ | |
| --push \ | |
| --set *.platform=linux/amd64,linux/arm64 |