Skip to content

Commit e0ee56b

Browse files
committed
Upload docker images to ghcr.io after release
1 parent f867144 commit e0ee56b

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/release-ghcr.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Push Image to ghcr.io
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
push:
8+
tags:
9+
- '**'
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
14+
jobs:
15+
build:
16+
name: "Upload to ghcr.io"
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Install Nix with good defaults
20+
uses: input-output-hk/install-nix-action@v21
21+
with:
22+
extra_nix_config: |
23+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
24+
substituters = https://cache.iog.io/ https://cache.nixos.org/
25+
nix_path: nixpkgs=channel:nixos-unstable
26+
27+
- name: Checkout repository
28+
uses: actions/checkout@v3
29+
30+
- name: Download image from cache
31+
run:
32+
nix build --builders "" --max-jobs 0 .#dockerImage -o dockerImage
33+
34+
- name: Log in to ghcr.io
35+
uses: docker/[email protected]
36+
with:
37+
registry: ${{ env.REGISTRY }}
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Upload to ghcr.io
42+
run: |
43+
docker load < dockerImage
44+
docker image tag \
45+
inputoutput/cardano-db-sync:$GITHUB_SHA \
46+
ghcr.io/${{ github.repository_owner }}/cardano-db-sync:$GITHUB_REF_NAME
47+
docker push ghcr.io/${{ github.repository_owner }}/cardano-db-sync:$GITHUB_REF_NAME

0 commit comments

Comments
 (0)