From 7f34a455e23d8e385b4ca413d2e20fa33e957539 Mon Sep 17 00:00:00 2001 From: Daniel O'Connell Date: Thu, 15 Feb 2024 16:09:15 +0100 Subject: [PATCH 1/2] Deploy test env --- .github/workflows/deploy-dev.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/deploy-dev.yml diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml new file mode 100644 index 00000000..dd4a69d5 --- /dev/null +++ b/.github/workflows/deploy-dev.yml @@ -0,0 +1,32 @@ +name: Deploy to dev Cloudflare Worker +on: + workflow_dispatch: + pull_request: + branches: + - stampy-redesign + types: + - closed +env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} +jobs: + deploy: + if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + steps: + - name: Clone stampy-ui repository code + uses: actions/checkout@v3 + - name: Deploy to Cloudflare + run: | + cat wrangler.toml.template \ + | sed s/stampy-ui/redesign/ \ + | sed s/{CLOUDFLARE_ACCT_ID}/${{ secrets.CLOUDFLARE_ACCT_ID }}/ \ + | sed s/{STAMPY_KV_ID}/${{ secrets.STAMPY_KV_ID }}/ \ + | sed s/{CODA_TOKEN}/${{ secrets.CODA_TOKEN }}/ \ + | sed s/{CODA_INCOMING_TOKEN}/${{ secrets.CODA_INCOMING_TOKEN }}/ \ + | sed s/{CODA_WRITES_TOKEN}/${{ secrets.CODA_WRITES_TOKEN }}/ \ + | sed s/{GOOGLE_ANALYTICS_ID}/${{ secrets.GOOGLE_ANALYTICS_ID }}/ \ + > wrangler.toml + npm ci + npm run deploy + - name: 'Debug: list files in build directory' + run: ls -R build public/build From 41be27beaf4dfce0184f77e469fb190d44c75942 Mon Sep 17 00:00:00 2001 From: Daniel O'Connell Date: Thu, 15 Feb 2024 17:34:42 +0100 Subject: [PATCH 2/2] change cloudflare account for tests --- .github/workflows/deploy-dev.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml index dd4a69d5..2176478d 100644 --- a/.github/workflows/deploy-dev.yml +++ b/.github/workflows/deploy-dev.yml @@ -19,8 +19,8 @@ jobs: run: | cat wrangler.toml.template \ | sed s/stampy-ui/redesign/ \ - | sed s/{CLOUDFLARE_ACCT_ID}/${{ secrets.CLOUDFLARE_ACCT_ID }}/ \ - | sed s/{STAMPY_KV_ID}/${{ secrets.STAMPY_KV_ID }}/ \ + | sed s/{CLOUDFLARE_ACCT_ID}/${{ secrets.CLOUDFLARE_ACCT_ID_APRILLION_WORKERS_DEV }}/ \ + | sed s/{STAMPY_KV_ID}/${{ secrets.STAMPY_KV_ID_APRILLION_WORKERS_DEV }}/ \ | sed s/{CODA_TOKEN}/${{ secrets.CODA_TOKEN }}/ \ | sed s/{CODA_INCOMING_TOKEN}/${{ secrets.CODA_INCOMING_TOKEN }}/ \ | sed s/{CODA_WRITES_TOKEN}/${{ secrets.CODA_WRITES_TOKEN }}/ \