Skip to content

debug: test bool

debug: test bool #74

Workflow file for this run

on:
push:
branches: [main, dynamic-matrix]
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
if: ${{ steps.changes.outputs.sites }}
id: matrix
run: |
if [[ ${{ steps.changes.outputs.packages }} == true ]] || [[ ${{ steps.changes.outputs.deps == true }} ]]; then
node ./scripts/build_sites.mjs --all
elif [[ ${{ steps.changes.outputs.sites }} == true ]]; then
node ./scripts/build_sites.mjs
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: Debug
run: |
echo "preparing to deploy:"
echo "Package: ${{ matrix.project }}"
echo "Project: ${{ matrix.package }}"
# - 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