From 481a4427069f87eb469240c57b2a047b22ba41d0 Mon Sep 17 00:00:00 2001 From: Jonah Aragon Date: Tue, 2 Apr 2024 05:10:38 -0500 Subject: [PATCH] more --- .github/workflows/deploy-all.yml | 51 +++++++++++++++++++++++++++ .github/workflows/publish-pr.yml | 22 ++++++------ .github/workflows/publish-release.yml | 13 +++---- .github/workflows/test-build.yml | 8 ++--- 4 files changed, 72 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/deploy-all.yml diff --git a/.github/workflows/deploy-all.yml b/.github/workflows/deploy-all.yml new file mode 100644 index 0000000000..9d680ede71 --- /dev/null +++ b/.github/workflows/deploy-all.yml @@ -0,0 +1,51 @@ +name: Deploy Website Build + +permissions: + contents: read + pages: write + id-token: write + +on: + workflow_call: + inputs: + netlify_production: + type: boolean + default: true + github_pages: + type: boolean + default: true + minio_production: + type: boolean + default: true + outputs: + netlify_preview_address: + value: ${{ jobs.netlify_preview.outputs.address }} + secrets: + NETLIFY_TOKEN: + PROD_MINIO_KEY_ID: + PROD_MINIO_SECRET_KEY: + +jobs: + netlify: + if: inputs.netlify_production + uses: privacyguides/.github/.github/workflows/deploy-netlify.yml@main + with: + netlify_site_id: ${{ vars.PROD_NETLIFY_SITE }} + environment: production + secrets: + NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }} + + minio: + if: inputs.minio_production + uses: privacyguides/.github/.github/workflows/deploy-minio.yml@main + with: + environment: production + secrets: + PROD_MINIO_KEY_ID: ${{ secrets.PROD_MINIO_KEY_ID }} + PROD_MINIO_SECRET_KEY: ${{ secrets.PROD_MINIO_SECRET_KEY }} + + pages: + if: inputs.github_pages + uses: privacyguides/.github/.github/workflows/deploy-pages.yml@main + with: + environment: github-pages diff --git a/.github/workflows/publish-pr.yml b/.github/workflows/publish-pr.yml index a223d5663c..b06b356275 100644 --- a/.github/workflows/publish-pr.yml +++ b/.github/workflows/publish-pr.yml @@ -30,15 +30,19 @@ concurrency: permissions: pull-requests: write contents: read - pages: write - id-token: write jobs: submodule: strategy: matrix: - repo: [mkdocs-material-insiders, brand, i18n] - uses: privacyguides/.github/workflows/download-repo.yml@main + repo: + - name: mkdocs-material-insiders + ref: main + - name: brand + ref: main + - name: i18n + ref: main + uses: privacyguides/.github/.github/workflows/download-repo.yml@main with: repo: ${{ matrix.repo }} secrets: @@ -56,7 +60,7 @@ jobs: fail-fast: false permissions: contents: read - uses: privacyguides/.github/workflows/build.yml@main + uses: privacyguides/.github/.github/workflows/build.yml@main with: ref: ${{github.event.pull_request.head.ref}} repo: ${{github.event.pull_request.head.repo.full_name}} @@ -67,12 +71,10 @@ jobs: needs: build permissions: contents: read - pages: write - id-token: write - uses: privacyguides/.github/workflows/deploy.yml@main + uses: privacyguides/.github/.github/workflows/deploy-netlify-preview.yml@main with: - netlify_preview: true netlify_alias: ${{ github.event.pull_request.head.sha }} + netlify_site_id: ${{ vars.NETLIFY_SITE }} secrets: NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }} @@ -98,4 +100,4 @@ jobs: cleanup: if: ${{ always() }} needs: build - uses: privacyguides/.github/workflows/cleanup.yml@main + uses: privacyguides/.github/.github/workflows/cleanup.yml@main diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 175218b5cb..018bb487ee 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -35,7 +35,7 @@ jobs: strategy: matrix: repo: [mkdocs-material-insiders, brand, i18n] - uses: privacyguides/.github/workflows/download-repo.yml@main + uses: privacyguides/.github/.github/workflows/download-repo.yml@main with: repo: ${{ matrix.repo }} secrets: @@ -48,7 +48,7 @@ jobs: lang: [en, es, fr, he, it, nl, ru, zh-Hant] permissions: contents: read - uses: privacyguides/.github/workflows/build.yml@main + uses: privacyguides/.github/.github/workflows/build.yml@main with: ref: ${{ github.ref }} repo: ${{ github.repository }} @@ -60,7 +60,7 @@ jobs: needs: submodule permissions: contents: read - uses: privacyguides/.github/workflows/build-offline.yml@main + uses: privacyguides/.github/.github/workflows/build-offline.yml@main release: name: Create release notes @@ -84,20 +84,17 @@ jobs: deploy: needs: build - uses: privacyguides/.github/workflows/deploy.yml@main + uses: ./.github/workflows/deploy-all.yml with: netlify_production: true github_pages: true - bunnycdn_production: true minio_production: true secrets: NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }} - PROD_BUNNYCDN_API_KEY: ${{ secrets.PROD_BUNNYCDN_API_KEY }} - PROD_BUNNYCDN_PASSWORD: ${{ secrets.PROD_BUNNYCDN_PASSWORD }} PROD_MINIO_KEY_ID: ${{ secrets.PROD_MINIO_KEY_ID }} PROD_MINIO_SECRET_KEY: ${{ secrets.PROD_MINIO_SECRET_KEY }} cleanup: if: ${{ always() }} needs: [build, buildoffline] - uses: privacyguides/.github/workflows/cleanup.yml@main + uses: privacyguides/.github/.github/workflows/cleanup.yml@main diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 71c489c56e..0ea076ce12 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -31,7 +31,7 @@ jobs: strategy: matrix: repo: [mkdocs-material-insiders, brand, i18n] - uses: privacyguides/.github/workflows/download-repo.yml@main + uses: privacyguides/.github/.github/workflows/download-repo.yml@main with: repo: ${{ matrix.repo }} secrets: @@ -45,7 +45,7 @@ jobs: fail-fast: false permissions: contents: read - uses: privacyguides/.github/workflows/build.yml@main + uses: privacyguides/.github/.github/workflows/build.yml@main with: ref: ${{ github.ref }} repo: ${{ github.repository }} @@ -56,9 +56,9 @@ jobs: needs: submodule permissions: contents: read - uses: privacyguides/.github/workflows/build-offline.yml@main + uses: privacyguides/.github/.github/workflows/build-offline.yml@main cleanup: if: ${{ always() }} needs: [build, buildoffline] - uses: privacyguides/.github/workflows/cleanup.yml@main + uses: privacyguides/.github/.github/workflows/cleanup.yml@main