cicd: light pipeline for front branch
This commit is contained in:
parent
90be4d134b
commit
522e7554fe
1 changed files with 54 additions and 0 deletions
54
.forgejo/workflows/front.yml
Normal file
54
.forgejo/workflows/front.yml
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
name: Build and Deploy (frontend build only)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- front
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Build frontend
|
||||
- uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version-file: modules/frontend/package.json
|
||||
cache: npm
|
||||
cache-dependency-path: modules/frontend/package-lock.json
|
||||
|
||||
- name: Build frontend
|
||||
env:
|
||||
VITE_BACKEND_API_BASE_URL: ${{ vars.BACKEND_API_BASE_URL }}
|
||||
run: |
|
||||
cd modules/frontend
|
||||
npm install
|
||||
npm run build
|
||||
tar -czvf nyanimedb-frontend.tar.gz dist/
|
||||
|
||||
- name: Upload built frontend to artifactory
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: nyanimedb-frontend.tar.gz
|
||||
path: modules/frontend/nyanimedb-frontend.tar.gz
|
||||
|
||||
# Build Docker images
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ vars.REGISTRY }}
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build and push frontend image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfiles/Dockerfile_frontend
|
||||
push: true
|
||||
tags: meowgit.nekoea.red/nihonium/nyanimedb-frontend:latest
|
||||
Loading…
Add table
Add a link
Reference in a new issue