Skip to content

Build and Push Docker Image #17

Build and Push Docker Image

Build and Push Docker Image #17

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- master
schedule:
- cron: '0 0 * * *' # Runs daily at midnight
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Get latest dbsync tag
id: get_latest_tag
run: |
latest_tag=$(curl -s https://api.github.com/repos/intersectmbo/cardano-db-sync/releases/latest | jq -r .tag_name)
echo "::set-output name=tag::$latest_tag"
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/cardano-db-sync:${{ steps.get_latest_tag.outputs.tag }}
build-args: |
DBSYNC_TAG=${{ steps.get_latest_tag.outputs.tag }}