Skip to content

cicd: refactor build pipeline #1

cicd: refactor build pipeline

cicd: refactor build pipeline #1

name: Container Build and Push
on:
workflow_call:
inputs:
image_name:
required: true
type: string
secrets:
GITHUB_TOKEN:

Check failure on line 10 in .github/workflows/container-build-push.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/container-build-push.yml

Invalid workflow file

secret name `GITHUB_TOKEN` within `workflow_call` can not be used since it would collide with system reserved name
required: true
DOCKER_HUB_USERNAME:
required: true
DOCKER_HUB_TOKEN:
required: true
jobs:
build-and-push:
permissions:
contents: read
packages: write
strategy:
matrix:
architecture: [x86_64, arm64]
runs-on: ${{ matrix.architecture == 'x86_64' && 'buildjet-8vcpu-ubuntu-2204' || 'buildjet-8vcpu-ubuntu-2204-arm' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub to Avoid Rate Limiting
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and Push Docker image movement
run: |
./scripts/movement/build-push-image ${{ inputs.image_name }}