Skip to content

docs: remove credit up top #90

docs: remove credit up top

docs: remove credit up top #90

Workflow file for this run

on:
push:
branches: [main]
jobs:
prepare:
name: Prepare Matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{steps.matrix.outputs.matrix}}
continue: ${{steps.matrix.outputs.continue}}
steps:
- name: Checkout
uses: actions/checkout@v3
- run: echo "SITES=$(jq -c . < sites.json)" >> $GITHUB_ENV
- name: Packages Changed
id: changes
with:
list-files: shell
filters: |
deps:
- 'package.json'
sites:
- 'sites/!(template/**)/**'
packages:
- 'packages/**'
uses: dorny/paths-filter@v3
- name: Transform Sites Changed
id: transformed-changes
run: |
sites=()
for filepath in ${{ steps.changes.outputs.sites_files }}; do
dir=$(echo "$filepath" | cut -d'/' -f2)
sites+=("$dir")
done
unique_sites=($(printf "%s\n" "${sites[@]}" | sort -u))
echo "SITES_CHANGED=${unique_sites[@]}" >> $GITHUB_ENV
- name: Build Dynamic Matrix
id: matrix
run: |
if [[ ${{ steps.changes.outputs.packages }} == true ]] || [[ ${{ steps.changes.outputs.deps }} == true ]]; then
node ./scripts/build_matrix.mjs --all
echo "continue=true" >> $GITHUB_OUTPUT
elif [[ ${{ steps.changes.outputs.sites }} == true ]]; then
node ./scripts/build_matrix.mjs
echo "continue=true" >> $GITHUB_OUTPUT
else
# successful step, but do not continue with a deployment
echo "continue=false" >> $GITHUB_OUTPUT
fi
publish:
needs: prepare
name: Publish to Cloudflare Pages
if: ${{ needs.prepare.outputs.continue == 'true' }}
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
permissions:
contents: read
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: npm ci --omit=dev
- name: Build
run: npm run build -w ./sites/${{ matrix.package }}
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.DEPLOY_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ matrix.project }}
directory: ./sites/${{ matrix.package }}/dist