Skip to content

Build and Publish Docker Image for Snapshot #179

Build and Publish Docker Image for Snapshot

Build and Publish Docker Image for Snapshot #179

Workflow file for this run

name: Build and Publish Docker Image for Snapshot
env:
DOCKER_REGISTRY_ACCOUNT: ${{ vars.DOCKER_REGISTRY_ACCOUNT }}
on:
release:
types: [ published ]
schedule:
- cron: '20 20 * * *'
workflow_dispatch:
jobs:
nightly:
runs-on: ubuntu-latest
steps:
- name: Extract service name from repo name
run: echo "SERVICE_NAME=$(echo '${{ github.repository }}' | cut -d'/' -f2)" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
- name: Optionally, login to Docker repository
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
if: env.DOCKER_USERNAME != null
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ env.DOCKER_REGISTRY_ACCOUNT }}/${{ env.SERVICE_NAME }}:nightly
build-args: |
SERVICE_NAME=${{ env.SERVICE_NAME }}