feat(ci): split nightly workflow into build and docker jobs with artifact sharing

This commit is contained in:
Tuan-Dat Tran
2026-02-23 20:13:12 +01:00
parent 3c219f3d9a
commit ba0eb585e3

View File

@@ -10,10 +10,9 @@ permissions:
packages: write
jobs:
nightly:
name: Build Nightly Image
build:
name: Build
runs-on: ubuntu-latest
environment: nightly
steps:
- name: Checkout
@@ -34,13 +33,37 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Install backend dependencies
working-directory: ./backend
run: npm ci
- name: Build
run: npm run build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 1
outputs:
date: ${{ steps.date.outputs.date }}
docker:
name: Build Nightly Image
runs-on: ubuntu-latest
needs: build
environment: nightly
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: master
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
@@ -69,9 +92,9 @@ jobs:
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/cv-app:nightly
${{ secrets.DOCKERHUB_USERNAME }}/cv-app:edge
${{ secrets.DOCKERHUB_USERNAME }}/cv-app:${{ steps.date.outputs.date }}
${{ secrets.DOCKERHUB_USERNAME }}/cv-app:${{ needs.build.outputs.date }}
ghcr.io/${{ github.repository_owner }}/cv-app:nightly
ghcr.io/${{ github.repository_owner }}/cv-app:edge
ghcr.io/${{ github.repository_owner }}/cv-app:${{ steps.date.outputs.date }}
ghcr.io/${{ github.repository_owner }}/cv-app:${{ needs.build.outputs.date }}
cache-from: type=gha
cache-to: type=gha,mode=max