forked from Emurgo/cardano-db-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.37 KB
/
release-ghcr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Push Image to ghcr.io
on:
release:
types:
- published
push:
tags:
- '**'
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/
nix_path: nixpkgs=channel:nixos-unstable
- name: Checkout repository
uses: actions/checkout@v3
- name: Download image from cache
run:
nix build --builders "" --max-jobs 0 .#dockerImage -o dockerImage
- 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: |
docker load < dockerImage
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