Skip to content

Commit

Permalink
chore: add github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
2paperstar committed Nov 29, 2023
1 parent b0c466a commit 04e781f
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Production Deploy

on:
release:
types:
- released

jobs:
preview-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v3
- name: build
run: |
yarn install --immutable --immutable-cache
VITE_MODE=production yarn build
- name: Deploy to production
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
projectName: idp-fe
directory: build
gitHubToken: ${{ github.token }}
- name: Update GitHub Deployment Status (success)
if: success()
uses: chrnorm/deployment-status@v2
with:
token: "${{ github.token }}"
state: "success"
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
34 changes: 34 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Staging Deploy

on:
push:
branches:
- main

jobs:
preview-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v3
- name: build
run: |
yarn install --immutable --immutable-cache
VITE_MODE=staging yarn build
- name: Deploy to production
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
projectName: idp-fe-stg
directory: build
gitHubToken: ${{ github.token }}
- name: Update GitHub Deployment Status (success)
if: success()
uses: chrnorm/deployment-status@v2
with:
token: "${{ github.token }}"
state: "success"
deployment-id: ${{ steps.deployment.outputs.deployment_id }}

0 comments on commit 04e781f

Please sign in to comment.