Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,45 @@ name: Deploy
on:
workflow_dispatch:

workflow_call:
secrets:
PAT:
description: 'Add a PAT to secrets.'
required: true
VERCEL_ORG_ID:
description: 'Add a VERCEL_ORG_ID to secrets.'
required: true
VERCEL_TOKEN:
description: 'Add a VERCEL_TOKEN to secrets.'
required: true
VERCEL_PROJECT_WIDGET_CONFIG:
description: 'Add a VERCEL_PROJECT_WIDGET_CONFIG to secrets.'
required: true
VERCEL_PROJECT_WIDGET_APP:
description: 'Add a VERCEL_PROJECT_WIDGET_APP to secrets.'
required: true
VERCEL_PROJECT_STORYBOOK:
description: 'Add a VERCEL_PROJECT_STORYBOOK to secrets.'
required: true
VERCEL_PROJECT_Q:
description: 'Add a VERCEL_PROJECT_Q to secrets.'
required: true
inputs:
branch:
description: 'Branch to checkout'
required: true
type: string
jobs:
deploy-it:
runs-on: ubuntu-latest
env:
TARGET_BRANCH: ${{ inputs.branch || github.ref }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT }}
ref: ${{ env.TARGET_BRANCH }}

- name: Prepare
uses: ./.github/actions/prepare
Expand All @@ -19,7 +50,7 @@ jobs:
yarn global add vercel
yarn run deploy
env:
REF: ${{ github.ref }}
REF: ${{ env.TARGET_BRANCH }}
GH_TOKEN: ${{ github.token }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
name: Release
name: Main Sync
on:
workflow_dispatch:

workflow_call:
secrets:
NPM_TOKEN:
description: 'You need a npm token to be set.'
required: true
PAT:
description: 'Add a PAT to secrets.'
required: true
jobs:
release:
main-sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -14,8 +22,8 @@ jobs:
- name: Prepare
uses: ./.github/actions/prepare

- name: Release Production
run: yarn run release-prod
- name: Sync main to the next
run: yarn run main-sync
env:
REF: ${{ github.ref }}
GH_TOKEN: ${{ github.token }}
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Post-Release
on:
workflow_dispatch:


workflow_call:
secrets:
PAT:
description: 'Add a PAT to secrets.'
required: true
inputs:
branch:
description: 'Branch to checkout'
required: true
type: string
jobs:
post-release:
runs-on: ubuntu-latest
env:
TARGET_BRANCH: ${{ inputs.branch || github.ref }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT }}
ref: ${{ env.TARGET_BRANCH }}

- name: Prepare
uses: ./.github/actions/prepare

- name: Post Release
run: yarn run post-release-prod
env:
REF: ${{ env.TARGET_BRANCH }}
GH_TOKEN: ${{ github.token }}
2 changes: 1 addition & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Prerelease
name: Pre-Release
on:
workflow_dispatch:

Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,30 @@ on:
branches:
- 'main'
- 'next'
workflow_dispatch:

workflow_call:
secrets:
NPM_TOKEN:
description: 'You need a npm token to be set.'
required: true
PAT:
description: 'Add a PAT to secrets.'
required: true
inputs:
branch:
description: 'Branch to checkout'
required: true
type: string
concurrency:
group: package-publishing

jobs:
publish:
timeout-minutes: 30
runs-on: ubuntu-latest
env:
TARGET_BRANCH: ${{ inputs.branch || github.ref }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -25,7 +41,7 @@ jobs:
- name: Build, Version & Publish packages
run: yarn run publish
env:
REF: ${{ github.ref }}
REF: ${{ env.TARGET_BRANCH }}
GH_TOKEN: ${{ github.token }}
# Github will create .npmrc based on this env variable.
# https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/release-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Production Release
on:
workflow_dispatch:

jobs:
main-sync:
uses: ./.github/workflows/main-sync.yml
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PAT: ${{ secrets.PAT }}

publish:
needs: main-sync
uses: ./.github/workflows/publish.yml
with:
branch:
refs/heads/main
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PAT: ${{ secrets.PAT }}

deploy:
needs: publish
uses: ./.github/workflows/deploy.yml
with:
branch:
refs/heads/main
secrets:
PAT: ${{ secrets.PAT }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_PROJECT_WIDGET_CONFIG: ${{ secrets.VERCEL_PROJECT_WIDGET_CONFIG }}
VERCEL_PROJECT_WIDGET_APP: ${{ secrets.VERCEL_PROJECT_WIDGET_APP }}
VERCEL_PROJECT_STORYBOOK: ${{ secrets.VERCEL_PROJECT_STORYBOOK }}
VERCEL_PROJECT_Q: ${{ secrets.VERCEL_PROJECT_Q }}

post-release:
needs: deploy
with:
branch:
refs/heads/next
uses: ./.github/workflows/post-release.yml
secrets:
PAT: ${{ secrets.PAT }}
Loading