Skip to content

Commit

Permalink
feat(actions): Add input field
Browse files Browse the repository at this point in the history
  • Loading branch information
1ilsang committed Jun 2, 2024
1 parent 05a2483 commit fd27864
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
13 changes: 10 additions & 3 deletions .github/actions/netlify-preview/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: netlify-preview

inputs:
NETLIFY_SITE_ID:
required: true
NETLIFY_API_TOKEN:
required: true

runs:
using: composite

Expand All @@ -9,15 +15,16 @@ runs:
id: netlify-deploy
shell: bash
run: |
pnpm nf \
pnpm nf deploy \
--dir out \
--site ${{ secrets.NETLIFY_SITE_ID }} \
--auth ${{ secrets.NETLIFY_API_TOKEN }} \
--site ${{ inputs.NETLIFY_SITE_ID }} \
--auth ${{ inputs.NETLIFY_API_TOKEN }} \
--json \
> deploy_output.json
- name: Generate URL Preview
id: url-preview
shell: bash
if: ${{ env.BRANCH_NAME == 'main' }}
run: |
NETLIFY_PREVIEW_URL=$(jq -r '.deploy_url' deploy_output.json)
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,14 @@ jobs:
steps:
- uses: actions/checkout@v4

# 캐싱 된 값을 사용
- name: 🌱 Install pnpm
uses: ./.github/actions/pnpm-install
- name: 🏗 Build and Export
uses: ./.github/actions/nextjs-build-export

- name: 🌈 Netlify preview
uses: ./.github/actions/netlify-preview
with:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_API_TOKEN: ${{ secrets.NETLIFY_API_TOKEN }}
Loading

0 comments on commit fd27864

Please sign in to comment.