Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaharagon committed Apr 2, 2024
1 parent e14ef45 commit 481a442
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 22 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/deploy-all.yml
Original file line number Diff line number Diff line change
@@ -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
22 changes: 12 additions & 10 deletions .github/workflows/publish-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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}}
Expand All @@ -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 }}

Expand All @@ -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
13 changes: 5 additions & 8 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand All @@ -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
Expand All @@ -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
8 changes: 4 additions & 4 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand All @@ -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

0 comments on commit 481a442

Please sign in to comment.