BLOG-9 Automatical deployment #33

Merged
zoe merged 3 commits from BLOG-9_automatical_deployment into main 2025-01-25 00:03:55 +08:00
2 changed files with 34 additions and 5 deletions
Showing only changes of commit a0b3c43f48 - Show all commits

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}}
zoe marked this conversation as resolved Outdated
Outdated
Review

Missing a space

          registry: ${{ vars.REGISTRY }}
Missing a space ```suggestion registry: ${{ vars.REGISTRY }} ```
Outdated
Review

Addressed in 290050700d

Addressed in 290050700d1c98790d019b5f5be92865888d88b2
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 && \
pnpm run build
FROM builder
WORKDIR /app
RUN apk add --no-cache tree && \
tree -L 3
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production