Skip to content

feat: add disregard functionality + upload flow for multiple docs (#65) #179

feat: add disregard functionality + upload flow for multiple docs (#65)

feat: add disregard functionality + upload flow for multiple docs (#65) #179

Workflow file for this run

name: Build and Push Docker Image
on:
push:
tags:
- 'v*'
branches:
- main
pull_request:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version to build'
required: true
default: 'latest'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ardaglobal/arda-platform
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Lint Dockerfile with hadolint
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile
no-color: false
no-fail: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: |
network=host
- name: Log in to GH Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=${{ github.event.inputs.version }},enable=${{ github.event_name == 'workflow_dispatch' }}
# For PRs, build single platform for speed
# For releases/main, build multi-platform
- name: Determine build platforms
id: platforms
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
else
echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
fi
- name: Build and push unified Docker image
id: build
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ steps.platforms.outputs.platforms }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
cache-to: type=inline
build-args: |
VITE_SERVER_ENVIRONMENT=production
VITE_ETHEREUM_RPC_URL=
# Attestation requires public repo or upgraded billing plan
# Uncomment when repository is public or billing plan is upgraded
# - name: Generate artifact attestation
# if: github.event_name != 'pull_request'
# uses: actions/attest-build-provenance@v1
# with:
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# subject-digest: ${{ steps.build.outputs.digest }}
# push-to-registry: true