Rabbitfrei #1493
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 Docker images | |
| on: | |
| pull_request: | |
| branches: [develop, master] | |
| push: | |
| branches: [develop] | |
| release: | |
| types: [published] | |
| jobs: | |
| docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: cachix/install-nix-action@v31.10.1 | |
| - uses: cachix/cachix-action@v17 | |
| with: | |
| name: lomas | |
| authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
| - name: Install devenv.sh | |
| run: nix profile add nixpkgs/64c08a7ca051951c8eae34e3e3cb1e202fe36786#devenv | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | |
| dsccadminch/lomas | |
| tags: | | |
| type=sha | |
| type=semver, pattern={{version}} | |
| type=raw,value=latest,enable=${{ github.event_name == 'release' }} | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v4.4.0 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USER }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build Image | |
| run: | | |
| nix build .#lomas-oci -o lomas-oci.tar | |
| nix build .#lomas-oci-raw -o lomas-oci-raw.tar | |
| - name: Push Image | |
| if: github.event_name == 'push' || github.event_name == 'release' | |
| run: | | |
| for tag in $DOCKER_METADATA_OUTPUT_TAGS; do | |
| skopeo copy docker-archive:lomas-oci.tar docker://dsccadminch/lomas:${tag##*:} | |
| skopeo copy docker-archive:lomas-oci-raw.tar docker://dsccadminch/lomas-raw:${tag##*:} | |
| done |