Skip to content

v2.0.0

v2.0.0 #8

Workflow file for this run

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 }}