Skip to content

ci(release): switch from @semantic-release/github to gitlab plugin #21

ci(release): switch from @semantic-release/github to gitlab plugin

ci(release): switch from @semantic-release/github to gitlab plugin #21

Workflow file for this run

# Shared GitHub Actions workflow template for apps using the common
# Dockerfile pattern (bun-based Next.js, multi-stage, NEXT_PUBLIC_* ARGs,
# port 3000, EXPOSE 3000).
#
# USAGE
#
# # In the app's repo, copy this file to .github/workflows/build.yml:
# mkdir -p .github/workflows
# curl -fsSL https://raw.githubusercontent.com/codenificient/afrotomation-infra/main/docs/app-build-workflow-template.yml \
# > .github/workflows/build.yml
#
# # Edit the image name at the bottom to match the repo (codeniwork).
#
# # Add these 7 GitHub Secrets under Settings → Secrets and variables → Actions:
# NEXT_PUBLIC_ANALYTICS_API_KEY
# NEXT_PUBLIC_ANALYTICS_ENDPOINT
# NEXT_PUBLIC_BETTER_AUTH_URL
# NEXT_PUBLIC_BETTER_STACK_SOURCE_TOKEN
# NEXT_PUBLIC_UMAMI_URL
# NEXT_PUBLIC_UMAMI_WEBSITE_ID
# # (NEXT_PUBLIC_ANALYTICS_ENABLED=true is hardcoded below)
#
# # Or bulk-set from a .env file:
# gh secret set -f /tmp/REPO_NAME-build-args.env -R codenificient/REPO_NAME
#
# # Commit + push — first build takes ~3 min, image lands at
# # ghcr.io/codenificient/REPO_NAME:latest
name: build-and-push
on:
push:
branches: [main, master]
tags: ['v*']
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build:
runs-on: arc-runner-set
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
# REPLACE codeniwork with the actual repo name
images: ghcr.io/${{ github.repository_owner }}/codeniwork
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,format=long
type=raw,value=latest,enable={{is_default_branch}}
- uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
# amd64 only. Arm64 QEMU builds take 15min+; we schedule these
# apps to vps50 (amd64) via nodeSelector in the k8s manifests.
# Re-add linux/arm64 here ONLY if you also want to schedule
# this app onto Oracle (ada, arm64).
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
NEXT_PUBLIC_ANALYTICS_API_KEY=${{ secrets.NEXT_PUBLIC_ANALYTICS_API_KEY }}
NEXT_PUBLIC_ANALYTICS_ENDPOINT=${{ secrets.NEXT_PUBLIC_ANALYTICS_ENDPOINT }}
NEXT_PUBLIC_ANALYTICS_ENABLED=true
NEXT_PUBLIC_BETTER_AUTH_URL=${{ secrets.NEXT_PUBLIC_BETTER_AUTH_URL }}
NEXT_PUBLIC_BETTER_STACK_SOURCE_TOKEN=${{ secrets.NEXT_PUBLIC_BETTER_STACK_SOURCE_TOKEN }}
NEXT_PUBLIC_UMAMI_URL=${{ secrets.NEXT_PUBLIC_UMAMI_URL }}
NEXT_PUBLIC_UMAMI_WEBSITE_ID=${{ secrets.NEXT_PUBLIC_UMAMI_WEBSITE_ID }}