Cancel tunnel after waitgroup completes #37
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 and Push Images | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| image: [controller, proxy, builder] | |
| arch: [x86_64, aarch64] | |
| include: | |
| - arch: x86_64 | |
| runner: ubuntu-latest | |
| - arch: aarch64 | |
| runner: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| id-token: write | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: DeterminateSystems/determinate-nix-action@v3 | |
| - uses: DeterminateSystems/flakehub-cache-action@main | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push ${{ matrix.image }} (${{ matrix.arch }}) | |
| run: | | |
| nix build .#${{ matrix.image }}-image | |
| docker load < result | |
| docker tag ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.image }}:latest \ | |
| ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.image }}-${{ matrix.arch }}:latest | |
| docker push ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.image }}-${{ matrix.arch }}:latest | |
| manifest: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' | |
| permissions: | |
| packages: write | |
| strategy: | |
| matrix: | |
| image: [controller, proxy, builder] | |
| steps: | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create multi-arch manifest | |
| run: | | |
| docker manifest create ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.image }}:latest \ | |
| --amend ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.image }}-x86_64:latest \ | |
| --amend ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.image }}-aarch64:latest | |
| docker manifest push ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.image }}:latest |