BLOG-9 feat: set up gitea workflow
All checks were successful
Frontend CI / build (push) Successful in 1m26s
PR Title Check / pr-title-check (pull_request) Successful in 15s

This commit is contained in:
SquidSpirit 2025-01-24 22:57:18 +08:00
parent bd648d59b4
commit a0b3c43f48
2 changed files with 34 additions and 5 deletions

View File

@ -0,0 +1,34 @@
name: Deployment
on:
release:
types:
- published
jobs:
frontend-deployment:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image and push to registry
uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY}}
username: ${{ vars.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
context: ./frontend
tags:
- ${{ vars.REGISTRY }}/${{ vars.IMAGE_REPO_FRONTEND }}:latest
- ${{ vars.REGISTRY }}/${{ vars.IMAGE_REPO_FRONTEND }}:${{ gitea.event.release.tag_name }}

View File

@ -15,11 +15,6 @@ COPY . .
RUN corepack enable pnpm && \ RUN corepack enable pnpm && \
pnpm run build pnpm run build
FROM builder
WORKDIR /app
RUN apk add --no-cache tree && \
tree -L 3
FROM base AS runner FROM base AS runner
WORKDIR /app WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production