fix: small fix #627
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: CD admin | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'apps/client/**' | |
- 'apps/api/**' | |
- '**/*.md' | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- 'apps/client/**' | |
- 'apps/api/**' | |
- '**/*.md' | |
# cancel any previously-started, yet still active runs of this workflow on the same branch | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
packages: write | |
env: | |
SUPABASE_STORAGE_URL: ${{ secrets.SUPABASE_STORAGE_URL }} | |
SUPABASE_DOMAIN: ${{ secrets.SUPABASE_DOMAIN }} | |
FORCE_COLOR: 1 | |
jobs: | |
admin: | |
name: CD Admin | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
outputs: | |
image-tag: ${{ steps.image-tag.outputs.image-tag }} | |
steps: | |
- name: 📦 Checkout Repository | |
id: checkout | |
uses: actions/checkout@v4 | |
- name: 🛠️ Set up QEMU | |
id: qemu | |
uses: docker/setup-qemu-action@v3 | |
- name: 🛠️ Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: 🏷️ Login to GHCR | |
id: login_ghcr | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: 🔖 Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v5 | |
with: | |
# list of Docker images to use as base name for tags | |
images: ghcr.io/${{ github.repository }}/admin | |
flavor: latest=auto | |
tags: | | |
type=raw,value=latest,enable={{is_default_branch}},priority=300 | |
type=ref,event=tag,priority=200 | |
- name: 🐳 Docker Build and Push | |
id: build_image | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64 | |
context: . | |
file: apps/admin/Dockerfile | |
target: prod | |
builder: ${{ steps.buildx.outputs.name }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
provenance: true | |
sbom: true | |
build-args: | |
| | |
PORT=3100 | |
NEXT_PUBLIC_API_URL=https://athlonix-api.jayllyz.fr | |
NEXT_PUBLIC_SOCKET_ENDPOINT=https://athlonix-api-sockets.jayllyz.fr | |
NEXT_PUBLIC_ATHLONIX_STORAGE_URL=${{ env.SUPABASE_STORAGE_URL }} | |
SUPABASE_DOMAIN=${{ env.SUPABASE_DOMAIN }} | |
- name: 💬 Set output | |
id: image-tag | |
run: | | |
# shellcheck disable=SC2086 | |
echo "image-tag=${{ steps.docker_meta.outputs.version }}" >> $GITHUB_OUTPUT | |
- name: 🚢 Deploy to Kubernetes | |
if: github.ref == 'refs/heads/main' | |
uses: actions-hub/kubectl@master | |
env: | |
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} | |
with: | |
args: rollout restart deployment athlonix-admin |