1313
1414env :
1515 REGISTRY : ghcr.io
16+ GH_TOKEN : ${{ github.token }}
1617
1718jobs :
1819 build :
19- name : " Upload to ghcr.io "
20+ name : " Build image "
2021 runs-on : ubuntu-latest
2122 steps :
2223 - name : Install Nix with good defaults
@@ -36,19 +37,16 @@ jobs:
3637 - name : Checkout repository
3738 uses : actions/checkout@v3
3839
40+ - name : Wait for Hydra
41+ uses : input-output-hk/actions/wait-for-hydra@latest
42+ with :
43+ check : ci/hydra-build:x86_64-linux.required
44+
3945 - name : Download image from cache
4046 run :
4147 nix build --builders "" --max-jobs 0 .#cardano-db-sync-docker
4248
43- - name : Log in to ghcr.io
44- uses : docker/login-action@v2.1.0
45- with :
46- registry : ${{ env.REGISTRY }}
47- username : ${{ github.actor }}
48- password : ${{ secrets.GITHUB_TOKEN }}
49-
50- - name : Upload to ghcr.io
51- if : ${{ github.ref_type == 'tags' || github.event_name == 'release' }}
49+ - name : Load image
5250 run : |
5351 # Downcase the package repository, because docker reference
5452 # are required to be lower case
6765 docker image tag \
6866 cardano-db-sync:latest \
6967 "${IMAGE_REF}:latest"
70- # Push the tags above
68+
69+ - name : Log in to ghcr.io
70+ uses : docker/login-action@v2.1.0
71+ with :
72+ registry : ${{ env.REGISTRY }}
73+ username : ${{ github.actor }}
74+ password : ${{ secrets.GITHUB_TOKEN }}
75+
76+ - name : Upload to ghcr.io
77+ if : ${{ github.ref_type == 'tags' || github.event_name == 'release' }}
78+ run : |
7179 docker push "${IMAGE_REF}:${IMAGE_TAG}"
7280 docker push "${IMAGE_REF}:latest"
0 commit comments