Skip to content

Commit

Permalink
ci: add preview deployments for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelarbibe committed Jun 29, 2024
1 parent 42c9f82 commit 901b980
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 26 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
on:
workflow_call:
inputs:
environment:
required: true
type: string
isProd:
required: true
type: boolean

jobs:
deploy_timeaxis:
uses: ./.github/workflows/deploy.yml
with:
environment: ${{ inputs.environment }} - dnd-timeline-timeaxis
isProd: ${{ inputs.isProd }}
secrets: inherit

deploy_performance:
uses: ./.github/workflows/deploy.yml
with:
environment: ${{ inputs.environment }} - dnd-timeline-performance
isProd: ${{ inputs.isProd }}
secrets: inherit

deploy_demo:
uses: ./.github/workflows/deploy.yml
with:
environment: ${{ inputs.environment }} - dnd-timeline-demo
isProd: ${{ inputs.isProd }}
secrets: inherit
11 changes: 11 additions & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Production - Deploy dnd-timeline examples
on:
pull_request:
types: [opened, synchronize]

jobs:
deploy_production:
uses: ./.github/workflows/deploy-examples.yml
with:
environment: Preview
secrets: inherit
13 changes: 13 additions & 0 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Production - Deploy dnd-timeline examples
on:
push:
branches:
- main

jobs:
deploy_production:
uses: ./.github/workflows/deploy-examples.yml
with:
environment: Production
isProd: true
secrets: inherit
7 changes: 5 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ on:
environment:
required: true
type: string
isProd:
type: boolean
default: false

jobs:
deploy_production:
deploy:
runs-on: ubuntu-latest
environment:
name: ${{ inputs.environment }}
Expand All @@ -24,4 +27,4 @@ jobs:
run: npm install --global vercel@latest
- name: Deploy to Vercel
id: deploy
run: echo "url=$(vercel --prod --yes --token=${{ secrets.VERCEL_TOKEN }})" >> "$GITHUB_OUTPUT"
run: echo "url=$(vercel --prod=${{ inputs.isProd }} --yes --token=${{ secrets.VERCEL_TOKEN }})" >> "$GITHUB_OUTPUT"
24 changes: 0 additions & 24 deletions .github/workflows/main.yml

This file was deleted.

0 comments on commit 901b980

Please sign in to comment.