From b052faec25e2fe0722bb0e2d08fcc8d6222137f1 Mon Sep 17 00:00:00 2001 From: James Humphries Date: Thu, 16 Nov 2023 14:50:12 +0000 Subject: [PATCH] Added deployment workflow Signed-off-by: James Humphries --- .github/workflows/generate-and-deploy.yml | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/generate-and-deploy.yml diff --git a/.github/workflows/generate-and-deploy.yml b/.github/workflows/generate-and-deploy.yml new file mode 100644 index 0000000000..83f388fa2c --- /dev/null +++ b/.github/workflows/generate-and-deploy.yml @@ -0,0 +1,36 @@ +name: Generate and Sync Files + +on: + workflow_dispatch + +jobs: + generate-and-sync: + runs-on: ubuntu-latest + + environment: Development + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: Setup dependencies + run: apt-get install rclone + + - name: Run Generation script + working-directory: ./src + run: go run ./cmd/generate-v1 + + - name: Sync Data to R2 + run: rclone sync ./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 }}