feat(ci): split nightly workflow into build and docker jobs with artifact sharing
This commit is contained in:
41
.github/workflows/nightly.yml
vendored
41
.github/workflows/nightly.yml
vendored
@@ -10,10 +10,9 @@ permissions:
|
|||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
nightly:
|
build:
|
||||||
name: Build Nightly Image
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: nightly
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -34,13 +33,37 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Install backend dependencies
|
|
||||||
working-directory: ./backend
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run 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
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
@@ -69,9 +92,9 @@ jobs:
|
|||||||
tags: |
|
tags: |
|
||||||
${{ secrets.DOCKERHUB_USERNAME }}/cv-app:nightly
|
${{ secrets.DOCKERHUB_USERNAME }}/cv-app:nightly
|
||||||
${{ secrets.DOCKERHUB_USERNAME }}/cv-app:edge
|
${{ 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:nightly
|
||||||
ghcr.io/${{ github.repository_owner }}/cv-app:edge
|
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-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|||||||
Reference in New Issue
Block a user