-
Notifications
You must be signed in to change notification settings - Fork 39
39 lines (31 loc) · 1.21 KB
/
generate-and-deploy-with-delete.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
# Be aware: This workflow should be kept in sync with generate-and-deploy.yml
name: Generate and Sync Files with Delete
on:
workflow_dispatch
jobs:
generate-and-sync:
runs-on: ubuntu-latest
environment: Production-with-delete
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: './src/go.mod'
- name: Setup dependencies
run: sudo apt-get install rclone
- name: Run Generation script
working-directory: ./src
run: go run ./cmd/generate-v1 --destination ../generated
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Sync Data to R2
run: rclone sync --checkers=512 --transfers=512 --checksum --fast-list ./generated R2:${{ secrets.R2_BUCKET_NAME }}
env:
# R2 credentials should be stored as GitHub secrets
RCLONE_CONFIG_R2_TYPE: s3
RCLONE_CONFIG_R2_PROVIDER: Cloudflare
RCLONE_CONFIG_R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
RCLONE_CONFIG_R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
RCLONE_CONFIG_R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }}