From c997d13dc39c212187d04bfdfa264dc1c6334e66 Mon Sep 17 00:00:00 2001 From: Zack Pollard Date: Thu, 22 Aug 2024 16:28:36 +0100 Subject: [PATCH] ci: deploy tiles gha --- .github/workflows/deploy-tiles.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-tiles.yml b/.github/workflows/deploy-tiles.yml index 4c7135e..8a78d7e 100644 --- a/.github/workflows/deploy-tiles.yml +++ b/.github/workflows/deploy-tiles.yml @@ -41,6 +41,13 @@ jobs: - name: Copy latest tiles to R2 run: rclone --progress copyto pmtiles:/${{ steps.latest_build.outputs.KEY }} r2:/tiles/${{ steps.latest_build.outputs.KEY }} --s3-no-check-bucket --s3-chunk-size=64M --multi-thread-streams=50 --checkers=512 + - name: Generate a token + id: generate-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.TF_APP_ID }} + private-key: ${{ secrets.TF_APP_PEM_FILE }} + - name: 'Checkout' uses: actions/checkout@v4 with: @@ -51,8 +58,9 @@ jobs: sed -i -E 's/"pmtiles_file_name": "(.*)"/"pmtiles_file_name": "${{ steps.latest_build.outputs.KEY }}"/' deployment/modules/cloudflare/tiles/tiles.tfvars.json - name: Push updated wrangler.toml to repo - uses: test-room-7/action-update-file@v1 + uses: EndBug/add-and-commit@v9 with: - file-path: deployment/modules/cloudflare/tiles/tiles.tfvars.json - commit-msg: Update tile server file to ${{ steps.latest_build.outputs.KEY }} - github-token: ${{ secrets.GITHUB_TOKEN }} + add: deployment/modules/cloudflare/tiles/tiles.tfvars.json + message: Update tile server file to ${{ steps.latest_build.outputs.KEY }} + ref: ${{ github.event.pull_request.head.ref }} + github-token: ${{ steps.generate-token.outputs.token }}