Skip to content

Commit

Permalink
feature(ci): Add wait-for-hydra
Browse files Browse the repository at this point in the history
  • Loading branch information
sgillespie committed May 21, 2024
1 parent 760e223 commit c5133af
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions .github/workflows/release-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ on:

env:
REGISTRY: ghcr.io
GH_TOKEN: ${{ github.token }}

jobs:
build:
name: "Upload to ghcr.io"
name: "Build image"
runs-on: ubuntu-latest
steps:
- name: Install Nix with good defaults
Expand Down Expand Up @@ -53,34 +54,48 @@ jobs:
echo "REPO_OWNER=${REPO_OWNER}" >> "$GITHUB_ENV"
echo "IMAGE_TAG=${IMAGE_TAG}" >> "$GITHUB_ENV"
- name: Wait for Hydra
uses: input-output-hk/actions/wait-for-hydra@latest
with:
check: ci/hydra-build:x86_64-linux.required

- name: Load images
run: |
# Download the images from the nix binary cachhe
nix build \
--builders "" \
--max-jobs 0 \
--out-link result-cardano-db-sync \
.#cardano-db-sync-docker
nix build \
--builders "" \
--max-jobs 0 \
--out-link result-cardano-smash-server
.#cardano-smash-server-docker
- name: Upload ${{ github.actor }}/cardano-db-sync
if: ${{ github.ref_type == 'tags' || github.event_name == 'release' }}
run: |
# Download the image from the nix binary cachhe
nix build --builders "" --max-jobs 0 .#cardano-db-sync-docker
# Push the image
skopeo copy \
docker-archive:./result \
docker-archive:./result-cardano-db-sync \
docker://ghcr.io/${REPO_OWNER}/cardano-db-sync:$IMAGE_TAG
# Also tag it as latest
skopeo copy \
docker-archive:./result \
docker-archive:./result-cardano-db-sync \
docker://ghcr.io/${REPO_OWNER}/cardano-db-sync:latest
- name: Upload ${{ github.actor }}/cardano-smash-server
if: ${{ github.ref_type == 'tags' || github.event_name == 'release' }}
run: |
# Download the image from the nix binary cachhe
nix build --builders "" --max-jobs 0 .#cardano-smash-server-docker
# Push the image
skopeo copy \
docker-archive:./result \
docker-archive:./result-cardano-smash-server \
docker://ghcr.io/${REPO_OWNER}/cardano-smash-server:$IMAGE_TAG
# Also tag it as latest
skopeo copy \
docker-archive:./result \
docker-archive:./result-cardano-smash-server \
docker://ghcr.io/${REPO_OWNER}/cardano-smash-server:latest

0 comments on commit c5133af

Please sign in to comment.