-
Notifications
You must be signed in to change notification settings - Fork 19
43 lines (41 loc) · 1.66 KB
/
Docker.yaml
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
name: Publish to Registry
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v19
- name: Nix build docker image
run: |
nix build .#dockerImage
docker load < result
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push docker image to DockerHub
run: |
IMG_ID=$( docker images --filter "reference=backend-ryo" --format "{{.ID}}" )
echo "Tagging $IMG_ID"
docker tag $IMG_ID blockfrost/backend-ryo:latest
docker tag $IMG_ID blockfrost/backend-ryo:${{ github.event.release.tag_name }}
docker push blockfrost/backend-ryo:latest
docker push blockfrost/backend-ryo:${{ github.event.release.tag_name }}
- name: Login to ghcr.io
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push docker image to ghcr.io
run: |
IMG_ID=$( docker images --filter "reference=backend-ryo" --format "{{.ID}}" )
echo "Tagging $IMG_ID"
docker tag $IMG_ID ghcr.io/blockfrost/blockfrost-backend-ryo:latest
docker tag $IMG_ID ghcr.io/blockfrost/blockfrost-backend-ryo:${{ github.event.release.tag_name }}
docker push ghcr.io/blockfrost/blockfrost-backend-ryo:latest
docker push ghcr.io/blockfrost/blockfrost-backend-ryo:${{ github.event.release.tag_name }}