Skip to content

Pre-flight check.

Pre-flight check. #2

Workflow file for this run

name: CD prod
on:
push:
branches: [ "master"]
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Determine the version tag
id: version_tag
run: |
if [[ ${{ github.ref_type }} == 'tag' ]]; then
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
else
echo "TAG_NAME=${GITHUB_SHA}" >> $GITHUB_ENV
fi
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
file: ./Dockerfile
push: true
tags: ghcr.io/shapeblock/operator:${{ env.TAG_NAME }}
cache-from: type=gha
cache-to: type=gha,mode=max