From a7196ff01e7cad25257faa0c678532dec11923b6 Mon Sep 17 00:00:00 2001 From: hanshino Date: Fri, 1 Nov 2024 18:07:31 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"feat:=20=E6=96=B0=E5=A2=9E=E6=AA=A2?= =?UTF-8?q?=E6=9F=A5=E5=BE=8C=E7=AB=AF=E5=92=8C=E5=89=8D=E7=AB=AF=E8=AE=8A?= =?UTF-8?q?=E6=9B=B4=E7=9A=84=E5=B7=A5=E4=BD=9C=E6=B5=81=E7=A8=8B=EF=BC=8C?= =?UTF-8?q?=E5=84=AA=E5=8C=96=E9=83=A8=E7=BD=B2=E6=A2=9D=E4=BB=B6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4337c48d29c9eaae8bdbced7279f5beafe57ee05. --- .github/workflows/main.yml | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b5e4049..4af8dcc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,36 +6,8 @@ on: - main jobs: - # Check for changes in backend and frontend - check-diff: - runs-on: ubuntu-latest - outputs: - backend_changed: ${{ steps.check_backend.outputs.changed }} - frontend_changed: ${{ steps.check_frontend.outputs.changed }} - steps: - - uses: actions/checkout@v4 - - - name: Check if backend has changes - id: check_backend - run: | - if git diff --quiet HEAD^ HEAD -- ./app; then - echo "changed=false" >> $GITHUB_OUTPUT - else - echo "changed=true" >> $GITHUB_OUTPUT - fi - - - name: Check if frontend has changes - id: check_frontend - run: | - if git diff --quiet HEAD^ HEAD -- ./frontend; then - echo "changed=false" >> $GITHUB_OUTPUT - else - echo "changed=true" >> $GITHUB_OUTPUT - fi - # Backend build and push job backend: - if: needs.check-diff.outputs.backend_changed == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -61,9 +33,8 @@ 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 + # Frontend build and push job, executed in parallel with backend frontend: - if: needs.check-diff.outputs.frontend_changed == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -91,11 +62,10 @@ jobs: build-args: | REACT_APP_GOOGLE_ANALYTICS_ID=${{ secrets.GOOGLE_ANALYTICS_ID }} - # Deployment job + # 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 - if: needs.backend.result == 'success' || needs.frontend.result == 'success' steps: - name: Deploy Redive linebot uses: appleboy/ssh-action@v1.1.0 @@ -113,4 +83,4 @@ jobs: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} uses: Ilshidur/action-discord@master with: - args: "{{ github.repository }} deployment complete." + args: "{{ EVENT_PAYLOAD.repository.full_name }} 已完成部署"