Skip to content

feat: regenerate asset data workflow #24

feat: regenerate asset data workflow

feat: regenerate asset data workflow #24

Workflow file for this run

name: Regenerate Asset Data and PR
on:
workflow_dispatch:
pull_request:
# schedule:
# - cron: '0 0 * * *' # Schedule to run automatically, uncomment for production use
jobs:
regenerate-and-create-pr:
runs-on: ubuntu-latest
if: github.event.pull_request.head.ref == 'feat_regenerate_asset_data_gh_action'
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 asset data
env:
ZERION_API_KEY: ${{ secrets.ZERION_API_KEY }}
run: yarn run generate:asset-data
- name: Create new feature branch
run: git checkout -B feat_regenerate_asset_data
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git diff --staged --quiet || git commit -m "feat: regenerate asset data"
git push -u origin feat_regenerate_asset_data
- name: Create Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create --base develop --head feat_regenerate_asset_data --title "feat: regenerate asset data" --body "Generated from CI."