test pipeline #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [main] | |
jobs: | |
publish: | |
name: Publish to Cloudflare Pages | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
projects: [gig-smart, eighth-light] | |
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: Set Target Sites | |
# if: steps.files_changed.outputs.sites == 'true' | |
# id: sites_matrix | |
# run: | | |
# echo "Should Deploy Targeted Sites" | |
# 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; | |
# | |
# - name: Set All Sites | |
# if: steps.files_changed.outputs.sites != 'true' | |
# run: | | |
# echo "Should Deploy All Sites" | |
# echo SITES=($(find ./sites -maxdepth 1 -mindepth 1 -type d ! -name ./sites -exec basename {} \;)) >> $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: ${{ toJson(steps.sites_matrix.outputs.SITES) }}" | |
- name: Install Dependencies | |
run: npm ci --omit=dev | |
# Run a build step here if your project requires | |
- name: Build | |
run: npm run build | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.DEPLOY_TOKEN }} | |
accountId: ${{ secrets.ACCOUNT_ID }} | |
projectName: ${{ matrix.projects }} | |
directory: ${{ matrix.projects }}/dist | |
# 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: | |
# workingDirectory: my-site | |
# Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta` | |
wranglerVersion: "3" |