-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (50 loc) · 1.76 KB
/
build-ozbargain-referrals-list.yml
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
51
52
53
54
55
56
57
name: Build OzBargain referrals list
on:
workflow_dispatch:
# schedule:
# - cron: '0 0 1 * *'
push:
branches:
- test-referrals-automate
jobs:
build-referrals-list:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up project
uses: ./.github/actions/setup-node-deps
- name: Build OzBargain referrals list
run: pnpm run build:referrals
env:
AXIOM_TOKEN: ${{ secrets.AXIOM_TOKEN }}
AXIOM_DATASET: ${{ secrets.AXIOM_DATASET }}
AXIOM_ORG_ID: ${{ secrets.AXIOM_ORG_ID }}
CLIENT_ID: blank
TOKEN: blank
DATABASE_URL: blank
- name: print out file
run: |
ls src/commands/referral/generated
cat src/commands/referral/generated/ozbargain-services.json
- name: Setup Git Credentials
run: |
git config --global user.email "[email protected]"
git config --global user.name "Vietausit Admin (Github Actions)"
git status --porcelain
- name: Compare changes and create PR if succeed
env:
GH_TOKEN: ${{ github.token }}
run: |
if [[ `git status --porcelain` ]]; then
git checkout -b automated-referrals-update
git add src/commands/referral
git commit -m "chore: update ozbargain referrals list"
git push -f -u origin automated-referrals-update
gh pr create --title "chore: update ozbargain referrals list" --body "this is generated via build-ozbargain-referrals-list.yml" --base master --head automated-referrals-update
else
echo "No changes to report"
fi