upgrade external dependencies (#619) #15
This file contains 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: "Release container images" | |
on: | |
push: | |
branches: | |
- main | |
- staging | |
paths: | |
- 'cmd/**' | |
- 'data/**' | |
- 'nix/**' | |
- 'src/**' | |
- 'flake.*' | |
- '.github/workflows/*' | |
tags: # Will run on all tags regardless of the paths filter | |
- '*' | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
container-release: | |
runs-on: ubuntu-latest | |
if: github.repository == 'letsblockit/letsblockit' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v24 | |
- uses: cachix/cachix-action@v14 | |
with: | |
name: letsblockit | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
- name: Generate common container labels | |
run: | | |
nix run .#update-labels | |
cat nix/labels.nix | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build server image | |
run: | | |
nix build .#server-container && ./result | docker load | |
- name: Push server-dev image from branch | |
if: ${{ github.ref_type == 'branch' }} | |
run: | | |
./scripts/push-container.sh server:latest server-dev:$GITHUB_REF_NAME | |
./scripts/push-container.sh server:latest server-dev:staging | |
./scripts/push-container.sh server:latest server-dev:${GITHUB_SHA::7} | |
- name: Build render image | |
if: ${{ github.ref_type == 'tag' }} | |
run: | | |
nix build .#render-container && ./result | docker load | |
- name: Push releases from tag | |
if: ${{ github.ref_type == 'tag' }} | |
run: | | |
./scripts/push-container.sh render:latest render:$GITHUB_REF_NAME | |
./scripts/push-container.sh render:latest | |
./scripts/push-container.sh server:latest server:$GITHUB_REF_NAME | |
./scripts/push-container.sh server:latest | |
- run: docker image list |