Update Static Data #6
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: Update Static Data | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Branch name' | |
required: true | |
type: string | |
default: main | |
environment: | |
description: Environment | |
required: true | |
type: choice | |
default: development | |
options: | |
- development | |
- production | |
folder: | |
description: 'Folder name' | |
required: false | |
type: string | |
concurrency: ${{ github.workflow }} | |
jobs: | |
master: | |
runs-on: ubuntu-22.04 | |
name: Update Static Data | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.branch }} | |
fetch-depth: 0 | |
token: ${{ secrets.GH_AUTOMATION_TOKEN }} | |
- name: Update data | |
env: | |
STRAPI_TOKEN: ${{ secrets.STRAPI_TOKEN }} | |
run: | | |
yarn install --immutable | grep -v 'YN0013' | |
yarn update-data ${{ github.event.inputs.environment }} ${{ github.event.inputs.folder }} | |
- name: Deploy to Cloudflare Pages | |
id: cloudflare_deployment | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: 'sw-static-data' | |
gitHubToken: ${{ secrets.GH_AUTOMATION_TOKEN }} | |
branch: ${{ github.event.inputs.branch }} | |
directory: './data' | |
wranglerVersion: '3' | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
author_name: Scheduler | |
author_email: [email protected] | |
message: 'Update Static Data' |