-
Notifications
You must be signed in to change notification settings - Fork 182
56 lines (46 loc) · 1.66 KB
/
generate.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
name: Regenerate Asset Data and PR
on:
# Allows manual triggering if we ever want to
workflow_dispatch:
schedule:
- cron: '0 9 * * 1,4' # Twice a week - 9AM UTC on Monday and Thursday
jobs:
regenerate-and-create-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout develop
uses: actions/checkout@v3
with:
ref: develop
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Yarn Install
run: yarn install --immutable
- name: Setup env
run: yarn env dev
- name: Build Packages
run: yarn build:packages
- name: Generate all assets
env:
ZERION_API_KEY: ${{ secrets.ZERION_API_KEY }}
run: yarn run generate:all
- name: Create new feature branch
run: git checkout -B feat_regenerate_asset_data
- name: Commit changes
run: |
git checkout -B feat_regenerate_asset_data
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
CURRENT_DATE=$(date +'%m/%d/%Y')
git diff --staged --quiet || git commit -m "feat: regenerate asset data $CURRENT_DATE"
git push -u origin feat_regenerate_asset_data -f
- name: Create Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GOMES_REPO_READONLY_GITHUB_SECRET }}
run: |
CURRENT_DATE=$(date +'%m/%d/%Y')
gh pr create --base develop --head feat_regenerate_asset_data --title "feat: regenerate asset data $CURRENT_DATE" --body "Generated from CI."