Skip to content

Commit

Permalink
chore: 調整 cicd 機制
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshino committed Oct 18, 2024
1 parent 5713658 commit b45bc81
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
26 changes: 25 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
- main

jobs:
docker:
# Backend build and push job
backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -32,6 +33,24 @@ jobs:
cache-from: type=registry,ref=hanshino/redive_backend:buildcache
cache-to: type=registry,ref=hanshino/redive_backend:buildcache,mode=max

# Frontend build and push job, executed in parallel with backend
frontend:
runs-on: ubuntu-latest
steps:
- 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: Log in to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Frontend build and push Docker image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
with:
Expand All @@ -43,6 +62,11 @@ jobs:
build-args: |
REACT_APP_GOOGLE_ANALYTICS_ID=${{ secrets.GOOGLE_ANALYTICS_ID }}
# Deployment job, dependent on both backend and frontend build completion
deploy:
runs-on: ubuntu-latest
needs: [backend, frontend] # Ensure that both backend and frontend jobs are finished before deploying
steps:
- name: Deploy Redive linebot
uses: appleboy/[email protected]
with:
Expand Down
1 change: 1 addition & 0 deletions scripts/traefik-run/001_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
"${COMPOSE_CMD[@]}" -f docker-compose.traefik.yml pull
"${COMPOSE_CMD[@]}" -f docker-compose.traefik.yml build
"${COMPOSE_CMD[@]}" -f docker-compose.traefik.yml up -d
"${COMPOSE_CMD[@]}" -f docker-compose.traefik.yml restart bot
"${COMPOSE_CMD[@]}" -f docker-compose.traefik.yml exec -T bot yarn migrate

0 comments on commit b45bc81

Please sign in to comment.