Generate and Sync Files with Delete #2
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
# 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 }} |