This repository was archived by the owner on Jun 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (66 loc) · 2.09 KB
/
update-static-data.yml
File metadata and controls
68 lines (66 loc) · 2.09 KB
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
58
59
60
61
62
63
64
65
66
67
68
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: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: Scheduler
author_email: scheduler@github.io
message: 'Update Static Data'
- name: Get Project name cloudflare
id: get_project_name_cf
run: |
echo ${{ github.event.repository.name }}
if [ ${{ github.event.repository.name }} == "Bitriel-Static-Content" ]; then
PROJECT_NAME="bitriel-static-data"
else
PROJECT_NAME="bitriel-static-data-dev"
fi
echo $PROJECT_NAME
echo "project_name=$PROJECT_NAME" >> $GITHUB_OUTPUT
- 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: ${{ steps.get_project_name_cf.outputs.project_name}}
token: ${{ secrets.GH_AUTOMATION_TOKEN }}
branch: ${{ github.event.inputs.branch }}
directory: './data'
wranglerVersion: '3'