Refactor: Nix flake cleanup #7
Workflow file for this run
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: Push Image to ghcr.io | ||
on: | ||
release: {} | ||
pull_request: {} | ||
push: {} | ||
workflow_dispatch: {} | ||
env: | ||
REGISTRY: ghcr.io | ||
jobs: | ||
wait-for-hydra: | ||
name: "Wait for hydra status" | ||
runs-on: ubuntu-latest | ||
needs: wait-for-hydra | ||
Check failure on line 16 in .github/workflows/release-ghcr.yml GitHub Actions / Push Image to ghcr.ioInvalid workflow file
|
||
env: | ||
HYDRA_JOB: ci/hydra-build:x86_64-linux.required | ||
GH_TOKEN: ${{ github.token }} | ||
steps: | ||
- uses: input-output-hk/actions/wait-for-hydra@latest | ||
with: | ||
status: ci/hydra-build:x86_64-linux.required | ||
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 | ||
if: github.ref_type == 'tag' || github.event_name == 'release' | ||
run: | | ||
docker load < result | ||
docker image tag \ | ||
inputoutput/cardano-db-sync:$GITHUB_SHA \ | ||
ghcr.io/${{ github.repository_owner }}/cardano-db-sync:$GITHUB_REF_NAME | ||
docker push ghcr.io/${{ github.repository_owner }}/cardano-db-sync:$GITHUB_REF_NAME |