Skip to content

Commit

Permalink
ci: Move deployment to Cloudflare Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Oct 10, 2023
1 parent b45b4b8 commit 1327754
Showing 1 changed file with 22 additions and 28 deletions.
50 changes: 22 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,34 +83,28 @@ jobs:
name: dist
path: dist

deploy-dev:
name: Deploy (dev)
needs: build
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
permissions:
id-token: write
contents: read
uses: ./.github/workflows/deploy.yml
with:
environment: dev
url: https://dev.mnemonic.ninja
bucket-name: dev.mnemonic.ninja
secrets:
aws-role-arn: ${{ secrets.DEV_AWS_ROLE_ARN }}
cloudfront-id: ${{ secrets.DEV_CLOUDFRONT_ID }}

deploy-prod:
name: Deploy (prod)
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v')
permissions:
id-token: write
contents: read
uses: ./.github/workflows/deploy.yml
with:
environment: prod
url: https://mnemonic.ninja
bucket-name: mnemonic.ninja
secrets:
aws-role-arn: ${{ secrets.PROD_AWS_ROLE_ARN }}
cloudfront-id: ${{ secrets.PROD_CLOUDFRONT_ID }}
deployments: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Deploy
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: mnemonic-ninja
directory: dist
gitHubToken: ${{ github.token }}
wranglerVersion: '3'

0 comments on commit 1327754

Please sign in to comment.