-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.43 KB
/
deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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"