diff --git a/.github/workflows/bot-autoassign-stale-pr.yml b/.github/workflows/bot-autoassign-stale-pr.yml index 80e4204..08861b6 100644 --- a/.github/workflows/bot-autoassign-stale-pr.yml +++ b/.github/workflows/bot-autoassign-stale-pr.yml @@ -12,6 +12,7 @@ concurrency: cancel-in-progress: false jobs: manage-stale-prs-python: + if: github.repository == 'openwisp/OpenWISP-Website' uses: openwisp/openwisp-utils/.github/workflows/reusable-bot-autoassign.yml@master with: bot_command: stale_pr diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c7f307..b572ca5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,8 +46,26 @@ jobs: - name: Build run: make publish + - name: Upload build output + uses: actions/upload-artifact@v4 + with: + name: site-output + path: output/ + + deploy: + if: > + github.repository == 'openwisp/OpenWISP-Website' && + github.event_name == 'push' + runs-on: ubuntu-24.04 + needs: build + steps: + - name: Download build output + uses: actions/download-artifact@v4 + with: + name: site-output + path: output/ + - name: Setup Google Cloud - if: ${{ github.event_name=='push' }} uses: "google-github-actions/auth@v3" with: credentials_json: ${{ secrets.GCS_DOWNLOADS_SERVICE_ACCOUNT_JSON }} @@ -55,11 +73,9 @@ jobs: export_environment_variables: true - name: Set up Cloud SDK - if: ${{ github.event_name=='push' }} uses: "google-github-actions/setup-gcloud@v3" - name: Deploy pages to openwisp.org - if: ${{ github.event_name=='push' }} run: gsutil -m rsync -r ${{ env.SRC_URL }} ${{ env.DST_URL }} env: SRC_URL: /home/runner/work/OpenWISP-Website/OpenWISP-Website/output/ @@ -67,12 +83,13 @@ jobs: invalidate-cache: runs-on: ubuntu-latest - needs: build - if: ${{ needs.build.result == 'success' }} && ${{ github.event_name=='push' }} + if: > + github.repository == 'openwisp/OpenWISP-Website' && + github.event_name == 'push' + needs: deploy steps: - name: Authenticate to Google Cloud - if: ${{ github.event_name=='push' }} uses: google-github-actions/auth@v3 with: credentials_json: ${{ secrets.GCS_DOWNLOADS_SERVICE_ACCOUNT_JSON }} @@ -80,7 +97,6 @@ jobs: export_environment_variables: true - name: Invalid CDN cache on GCP - if: ${{ github.event_name=='push' }} uses: stefanodotit/github-actions-invalidate-gcp-cdn@v1 with: load_balancer_name: ${{ secrets.GCS_MAIN_LOAD_BALANCER_NAME }}