Skip to content

Commit

Permalink
💚 Fix workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
harehare committed Sep 20, 2023
1 parent 48a08d8 commit a77ac61
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/branch_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
branch-deploy:
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-latest
outputs:
continue: ${{ steps.branch-deploy.outputs.continue }}
ref: ${{ steps.branch-deploy.outputs.ref }}
steps:
- uses: github/branch-deploy@v7.3.0
id: branch-deploy
Expand All @@ -23,3 +26,5 @@ jobs:
if: ${{ jobs.branch-deploy.outputs.continue == 'true' }}
uses: ./.github/workflows/build_and_deploy.yml
secrets: inherit
with:
ref: ${{ jobs.branch-deploy.outputs.ref }}
6 changes: 6 additions & 0 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: build_and_deploy

on:
workflow_call:
inputs:
ref:
required: true
type: string

jobs:
build:
Expand All @@ -11,6 +15,8 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: actions/setup-node@v3
with:
node-version-file: ".tool-versions"
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@ name: deploy
on:
workflow_dispatch:
inputs:
environment:
description: "Environment to run"
type: environment
default: production
branch:
description: "deploy branch"
required: true
default: "master"
type: choice
options:
- master
- release
- develop

jobs:
deploy:
uses: ./.github/workflows/build_and_deploy.yml
secrets: inherit
with:
ref: ${{ inputs.branch }}

0 comments on commit a77ac61

Please sign in to comment.