Skip to content

trigger build

trigger build #19

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: |
lib:
- 'packages/common/**/*'
sites:
- 'sites/**/*'
# helper to extract the sites that were modified
# input_string="/home/sites/my-site/src/index.html"; echo "${input_string#*/sites/}" | cut -d'/' -f1
# run only if some file in 'src' folder was changed
# - if: steps.files_changed.outputs.src == 'true'
# run: ...
- name: Build Matrix
id: sites-matrix
run: |
site_paths=(${{ toJson(steps.files_changed.outputs.sites_files) }})
sites=()
for i in "${site_paths[@]}";
do
site="${i#*/sites/}" | cut -d'/' -f1;
sites+=("$site");
echo ${site};
done
echo SITES="${sites}" >> $GITHUB_OUTPUT;
- 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: ${{ 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"