Skip to content

Commit

Permalink
Workflows for auto deploy to our integration servers (otterscan#2000)
Browse files Browse the repository at this point in the history
* Add deployment script to gnosis integration server

* Fix env

* Add wrangler

* Change command

* Silence warning on purpose

* Parameterize workflow for reuse

* Fixes

* More fixes

* Add op-mainnet integration server

* Fix prettier
  • Loading branch information
wmitsuda authored Apr 13, 2024
1 parent a5c5838 commit 45d8133
Show file tree
Hide file tree
Showing 4 changed files with 1,678 additions and 22 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/integration-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
on: [push]
jobs:
deploy-gnosis:
uses: ./.github/workflows/pages-deployment.yaml
secrets:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_INTEG_GNOSIS_PROJECT }}
viteConfigJson: ${{ secrets.CLOUDFLARE_INTEG_GNOSIS_SETTINGS }}
deploy-op-mainnet:
uses: ./.github/workflows/pages-deployment.yaml
secrets:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_INTEG_OP_MAINNET_PROJECT }}
viteConfigJson: ${{ secrets.CLOUDFLARE_INTEG_OP_MAINNET_SETTINGS }}
38 changes: 38 additions & 0 deletions .github/workflows/pages-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
workflow_call:
secrets:
apiToken:
required: true
accountId:
required: true
projectName:
required: true
viteConfigJson:
required: true

jobs:
deploy-cloudflare:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"
- name: Install packages
run: npm ci
- name: Build Otterscan
run: npm run build
env:
VITE_CONFIG_JSON: ${{ secrets.viteConfigJson }}
- name: Publish
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.apiToken }}
accountId: ${{ secrets.accountId }}
command: pages deploy dist --project-name=${{ secrets.projectName }} --commit-dirty=true
Loading

0 comments on commit 45d8133

Please sign in to comment.