Skip to content

Prepare Release 13.2.0.1 #18

Prepare Release 13.2.0.1

Prepare Release 13.2.0.1 #18

Workflow file for this run

name: Push Image to ghcr.io
on:
release:
types:
- published
push:
tags:
- '**'
workflow_dispatch: {}
env:
REGISTRY: ghcr.io
jobs:
build:
name: "Upload to ghcr.io"
runs-on: ubuntu-latest
steps:
- name: Install Nix with good defaults
uses: input-output-hk/install-nix-action@v21
with:
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
substituters = https://cache.iog.io/ https://cache.nixos.org/
experimental-features = nix-command flakes fetch-closure
allow-import-from-derivation = true
accept-flake-config = true
nix_path: nixpkgs=channel:nixos-unstable
# cardano-parts requires nix >= 2.17.0; We can remove this after the next release
# to install-nix-action (v23)
install_url: https://releases.nixos.org/nix/nix-2.17.0/install
- name: Checkout repository
uses: actions/checkout@v3
- name: Download image from cache
run:
nix build --builders "" --max-jobs 0 .#cardano-db-sync-docker
- name: Log in to ghcr.io
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to ghcr.io
run: |
# Downcase the package repository, because docker reference
# are required to be lower case
REPO_OWNER="$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')"
IMAGE_REF="ghcr.io/$REPO_OWNER/cardano-db-sync"
IMAGE_TAG="$GITHUB_REF_NAME"
# Load the image from the nix build result
docker load < result
# Tag the image
docker image tag \
cardano-db-sync:latest \
"${IMAGE_REF}:${IMAGE_TAG}"
# Also tag it as latest
docker image tag \
cardano-db-sync:latest \
"${IMAGE_REF}:latest"
# Push the tags above
docker push "${IMAGE_REF}:${IMAGE_TAG}"
docker push "${IMAGE_REF}:latest"