Skip to content

Release

Release #18

Workflow file for this run

name: Release
on: workflow_dispatch
defaults:
run:
shell: bash # Implies `set -eo pipefail`, among other things. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
jobs:
deploy-x86_64-linux:
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# We could use github artifacts, but it seems that it's not so trivial to use them across different workflows
# unless we use a third party action. So we just rely on Nix and our cachix cache.
- uses: cachix/install-nix-action@v24
with:
install_url: https://releases.nixos.org/nix/nix-2.8.1/install
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
substituters = https://cache.nixos.org https://mzabani.cachix.org https://cache.iog.io
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= mzabani.cachix.org-1:wnkKakfl+rbT7zTtV1P1tAtjBTuh6GQVX7LfSd9sMbA= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
- uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get docker image from cachix and push to DockerHub
run: |
# We don't want to build things all over again, so make sure they're in the cache with -j0
nix build -j0 -o results/codd-docker .#dockerImage.x86_64-linux
docker load -i results/codd-docker
# Push both to the ref (tag name) and latest
docker tag codd:latest "mzabani/codd:$GITHUB_REF_NAME"
docker tag codd:latest mzabani/codd:latest
docker push "mzabani/codd:$GITHUB_REF_NAME"
docker push mzabani/codd:latest