Skip to content

trigger build

trigger build #35

Workflow file for this run

on:
push:
branches: [main]
jobs:
publish:
name: Publish to Cloudflare Pages
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: dorny/paths-filter@v3
id: files_changed
with:
list-files: "shell"
filters: |
deps:
- "package-lock.json"
lib:
- "packages/common/**/*"
sites:
- "sites/**/*"
# - if: steps.files_changed.outputs.src == 'true'
# run: ...
- name: Build Matrix
id: sites_matrix
run: |

Check failure on line 32 in .github/workflows/publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/publish.yml

Invalid workflow file

The workflow is not valid. .github/workflows/publish.yml (Line: 32, Col: 14): Unexpected symbol: '"true"'. Located at position 37 within expression: steps.files_changed.outputs.deps == "true"
if [${{steps.files_changed.outputs.deps == "true"}}] || [${{steps.files_changed.outputs.lib == "true"}}]
then
# core changes - deploy all sites
echo SITES=$()
# all_sites=($(find ./sites -maxdepth 1 -mindepth 1 -type d ! -name ./sites -exec basename {} \;))
# echo SITES="${all_sites[@]}"
echo SITES=($(find ./sites -maxdepth 1 -mindepth 1 -type d ! -name ./sites -exec basename {} \;)) >> $GITHUB_OUTPUT;
elif [${{steps.files_changed.outputs.sites == "true"}}]
then
site_paths=(${{steps.files_changed.outputs.sites_files}})
sites=()
for i in "${site_paths[@]}";
do
sites_directory="${i#*sites/}"
sites_directory="${sites_directory%%/*}"
sites+=("$sites_directory")
done
unique_sites=($(echo "${sites[@]}" | tr ' ' '\n' | sort -u))
echo SITES="${unique_sites[@]}" >> $GITHUB_OUTPUT;
else
echo SITES=$() >> $GITHUB_OUTPUT;
fi
- name: List Changed Files
run: |
echo "Changed lib files: ${{ steps.files_changed.outputs.lib_files }}"
echo "Changed sites files: ${{ steps.files_changed.outputs.sites_files }}"
echo "Sites Matrix: ${{ toJson(steps.sites_matrix.outputs.SITES) }}"
# Run a build step here if your project requires
# - name: Publish to Cloudflare Pages
# uses: cloudflare/pages-action@v1
# with:
# apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# accountId: YOUR_ACCOUNT_ID
# projectName: YOUR_PROJECT_NAME
# directory: YOUR_BUILD_OUTPUT_DIRECTORY
# # Optional: Enable this if you want to have GitHub Deployments triggered
# gitHubToken: ${{ secrets.GITHUB_TOKEN }}
# # Optional: Switch what branch you are publishing to.
# # By default this will be the branch which triggered this workflow
# branch: main
# # Optional: Change the working directory
# workingDirectory: my-site
# # Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta`
# wranglerVersion: "3"