Make changes to check for broken links #22
Workflow file for this run
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
name: Encode and deploy | |
on: | |
# when someone makes a change directly to main branch | |
push: | |
branches: | |
- main | |
# when someone requests a change to main branch | |
pull_request: | |
branches: | |
- main | |
env: | |
website_repo: redirects-website | |
jobs: | |
encode: | |
runs-on: ubuntu-latest | |
steps: | |
- if: runner.debug == '1' | |
uses: mxschmitt/action-tmate@v3 | |
- name: Get this repo's code | |
uses: actions/checkout@v4 | |
with: | |
path: redirects-repo # save in separate sub-folder | |
- name: Get website repo's code | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.repository_owner }}/${{ env.website_repo }} # assume same user/org | |
path: website-repo # save in separate sub-folder | |
- name: Set up Bun | |
uses: oven-sh/setup-bun@v1 | |
- name: Install packages | |
run: bun install glob@v9 yaml@v2 | |
- name: Run encode script | |
run: bun ./redirects-repo/encode.js | |
- name: Commit result to website repo | |
if: ${{ github.event_name == 'push' }} | |
uses: leigholiver/[email protected] | |
with: | |
source: ./website-repo/redirect.js # only file changed by encode script | |
destination_repo: ${{ github.repository_owner }}/${{ env.website_repo }} # assume same user/org | |
deploy_key: ${{ secrets.DEPLOY_KEY }} # permission to commit to different repo | |
commit_message: "Update redirects" |