Skip to content

Commit

Permalink
fix: more reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias committed Aug 25, 2022
1 parent e618f14 commit f4ca6ab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 86 deletions.
66 changes: 8 additions & 58 deletions .github/workflows/access-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,64 +33,14 @@ jobs:
- run: pnpm -r --filter @web3-storage/access-api run lint
- run: pnpm -r --filter @web3-storage/access-api run test
deploy-staging:
needs: test
runs-on: ubuntu-latest
if: github.head_ref == 'release-please--branches--master--components--access-api'
environment: staging
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.0.1
with:
version: 7
- uses: actions/setup-node@v2
with:
node-version: 18
cache: 'pnpm'
- run: pnpm install
# Publish worker to cloudflare
- uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CF_TOKEN }}
workingDirectory: 'packages/access-api'
environment: staging
secrets: |
POSTMARK_TOKEN
PRIVATE_KEY
SENTRY_DSN
env:
POSTMARK_TOKEN: ${{ secrets.POSTMARK_TOKEN }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_UPLOAD: ${{ secrets.SENTRY_UPLOAD }}
SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }}
uses: './.github/workflows/reuse-deploy-api.yml'
with:
environment: staging
secrets: inherit
deploy-dev:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && !contains(github.head_ref, 'release-please--branches')
environment: dev
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.0.1
with:
version: 7
- uses: actions/setup-node@v2
with:
node-version: 18
cache: 'pnpm'
- run: pnpm install
# Publish worker to cloudflare
- uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CF_TOKEN }}
workingDirectory: 'packages/access-api'
environment: dev
secrets: |
POSTMARK_TOKEN
PRIVATE_KEY
SENTRY_DSN
env:
POSTMARK_TOKEN: ${{ secrets.POSTMARK_TOKEN }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_UPLOAD: ${{ secrets.SENTRY_UPLOAD }}
SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }}
uses: './.github/workflows/reuse-deploy-api.yml'
with:
environment: dev
secrets: inherit
28 changes: 1 addition & 27 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,30 +55,4 @@ jobs:
uses: './.github/workflows/reuse-deploy-api.yml'
with:
environment: ${{ github.event.inputs.environment }}
secrets:
inherit
# - uses: actions/checkout@v2
# - uses: pnpm/action-setup@v2.0.1
# with:
# version: 7
# - uses: actions/setup-node@v2
# with:
# node-version: 18
# cache: 'pnpm'
# - run: pnpm install
# # Publish worker to cloudflare
# - uses: cloudflare/wrangler-action@2.0.0
# with:
# apiToken: ${{ secrets.CF_TOKEN }}
# workingDirectory: 'packages/access-api'
# environment: ${{ github.event.inputs.environment }}
# secrets: |
# POSTMARK_TOKEN
# PRIVATE_KEY
# SENTRY_DSN
# env:
# POSTMARK_TOKEN: ${{ secrets.POSTMARK_TOKEN }}
# PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
# SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
# SENTRY_UPLOAD: ${{ secrets.SENTRY_UPLOAD }}
# SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }}
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/reuse-deploy-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
required: true

jobs:
deploy_api:
deploy-api:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
Expand Down

0 comments on commit f4ca6ab

Please sign in to comment.