Skip to content

Commit

Permalink
feat: pull requestのときのみDeploy Previewを実施しPR上でURLを確認できるようにする
Browse files Browse the repository at this point in the history
  • Loading branch information
mii288 committed Aug 18, 2024
1 parent 2217e89 commit 3b28a04
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: CI

on:
pull_request:
types: [opened, synchronize]
push:
branches:
- '**'
Expand All @@ -9,6 +11,7 @@ on:

jobs:
build:
if: github.event_name == 'pull_request'
name: Build
runs-on: ubuntu-latest

Expand All @@ -18,16 +21,27 @@ jobs:
- uses: ./.github/actions/setup
- run: npm run build
name: Run build
- uses: nwtgck/actions-netlify@v1.0
name: deploy to netlify
- uses: ./.github/actions/netlify
id: netlify
timeout-minutes: 1
with:
publish-dir: './out'
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
publish-dir: ./.out
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
### :white_check_mark: Deploy preview is ready!
| Name | Link |
|----|----|
| :hammer: Latest commit | ${{ github.sha }} |
| :sunglasses: Deploy Preview | ${{ steps.netlify.outputs.netlify-url }} |
comment_tag: deploy-preview

lint:
if: github.event_name == 'push'
name: Lint
runs-on: ubuntu-latest

Expand Down

0 comments on commit 3b28a04

Please sign in to comment.