Skip to content

Remove per-language config files #4

Remove per-language config files

Remove per-language config files #4

Workflow file for this run

name: 🛠️ Build PR Preview
on:
pull_request:
concurrency:
group: ${{github.event.pull_request.head.ref}}
cancel-in-progress: true
permissions:
contents: read
jobs:
metadata:
runs-on: ubuntu-latest
outputs:
submodules: ${{ steps.submodules.outputs.submodules }}
privileged: ${{ steps.submodules.outputs.privileged }}
matrix: ${{ steps.matrix-fork.outputs.matrix || steps.matrix-main.outputs.matrix }}
env:
ACTIONS_SSH_KEY: ${{ secrets.ACTIONS_SSH_KEY }}
steps:
- name: Set matrix for fork
if: env.ACTIONS_SSH_KEY == ''
id: matrix-fork
uses: druzsan/setup-matrix@v2
with:
matrix: |
repo: [brand, i18n]
- name: Set matrix for main repo
if: env.ACTIONS_SSH_KEY != ''
id: matrix-main
uses: druzsan/setup-matrix@v2
with:
matrix: |
repo: [brand, i18n, mkdocs-material-insiders]
- name: Set submodules for fork
if: env.ACTIONS_SSH_KEY == ''
id: submodules
run: |
echo "submodules="[brand, i18n]"" >> "$GITHUB_OUTPUT"
echo "privileged=false" >> "$GITHUB_OUTPUT"
- name: Set submodules for main repo
if: env.ACTIONS_SSH_KEY != ''
run: |
echo "submodules="[brand, i18n, webserver]"" >> "$GITHUB_OUTPUT"
echo "privileged=true" >> "$GITHUB_OUTPUT"
- name: Save PR metadata
run: |
mkdir -p ./metadata
echo ${{ github.event.number }} > ./metadata/NR
echo ${{ github.event.pull_request.head.sha }} > ./metadata/SHA
- name: Upload metadata as artifact
uses: actions/upload-artifact@v4
with:
name: metadata
path: metadata
submodule:
needs: metadata
strategy:
matrix: ${{ fromJson(needs.metadata.outputs.matrix) }}
uses: privacyguides/.github/.github/workflows/download-repo.yml@main
with:
repo: ${{ matrix.repo.name }}
privileged: ${{ needs.metadata.outputs.privileged }}
secrets:
ACTIONS_SSH_KEY: ${{ secrets.ACTIONS_SSH_KEY }}
build:
needs: [submodule, metadata]
strategy:
matrix:
lang: [es, fr, he, it, nl, ru, zh-Hant]
allow-error: [true]
include:
- lang: en
allow-error: false
fail-fast: false
uses: ./.github/workflows/build.yml
with:
ref: ${{github.event.pull_request.head.ref}}
repo: ${{github.event.pull_request.head.repo.full_name}}
lang: ${{ matrix.lang }}
continue-on-error: ${{ matrix.allow-error }}
privileged: ${{ fromJSON(needs.metadata.outputs.privileged) }}
combine_build:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: site-build-*
merge-multiple: true
- run: |
for file in *.tar.gz; do tar -zxf "$file"; done
ls -la site/
- name: Upload Site
uses: actions/upload-artifact@v4
with:
name: site-build-combined
path: site
retention-days: 5
cleanup:
if: ${{ always() }}
needs: build
uses: privacyguides/.github/.github/workflows/cleanup.yml@main