Using direnv and nix-direnv #17
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: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| packages: write | |
| strategy: | |
| matrix: | |
| image: [controller, proxy, builder] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - uses: DeterminateSystems/determinate-nix-action@v3 | |
| - uses: DeterminateSystems/flakehub-cache-action@main | |
| - name: Log in to Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build ${{ matrix.image }} image | |
| run: nix build .#${{ matrix.image }}-image | |
| - name: Load and push ${{ matrix.image }} image | |
| run: | | |
| docker load < result | |
| docker push ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.image }}:latest |