Skip to content

Commit

Permalink
chore: github workflows for access-api add URLs to dev/staging/produc…
Browse files Browse the repository at this point in the history
…tion envs (#157)

so the github ui adds links to the deployments

Motivation:
* so the github deployments on this repo have a nice 'View Deployment'
button that opens the URL of the deployment
* like this other repo
https://github.com/elastic-ipfs/metrics-collector/deployments

Co-authored-by: Hugo Dias <hugomrdias@gmail.com>
  • Loading branch information
gobengo and hugomrdias committed Nov 14, 2022
1 parent 12f44a0 commit 4e0700f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/access-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ jobs:
uses: './.github/workflows/reuse-deploy-api.yml'
with:
environment: staging
environment_url: https://w3access-staging.protocol-labs.workers.dev
secrets: inherit
deploy-dev:
needs: test
if: github.event_name == 'pull_request' && !contains(github.head_ref, 'release-please--branches')
uses: './.github/workflows/reuse-deploy-api.yml'
with:
environment: dev
environment_url: https://w3access-dev.protocol-labs.workers.dev
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@ jobs:
uses: './.github/workflows/reuse-deploy-api.yml'
with:
environment: production
environment_url: https://access.web3.storage
secrets: inherit
8 changes: 7 additions & 1 deletion .github/workflows/reuse-deploy-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
environment:
required: true
type: string
environment_url:
description: URL of the deployed environment. If provided, this will be added to the GitHub environment.
required: false
type: string
secrets:
CF_TOKEN:
required: true
Expand All @@ -24,7 +28,9 @@ on:
jobs:
deploy-api:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
environment:
name: ${{ inputs.environment }}
url: ${{ inputs.environment_url }}
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.3
Expand Down

0 comments on commit 4e0700f

Please sign in to comment.