From 7309c05f50da213465b9dfd34e8ea3523f324209 Mon Sep 17 00:00:00 2001 From: phenylshima <49227365+femshima@users.noreply.github.com> Date: Wed, 13 Sep 2023 20:22:20 +0900 Subject: [PATCH 1/2] preview build/deploy in gh actions --- .github/workflows/netlify.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/netlify.yml diff --git a/.github/workflows/netlify.yml b/.github/workflows/netlify.yml new file mode 100644 index 0000000000..649b9a4225 --- /dev/null +++ b/.github/workflows/netlify.yml @@ -0,0 +1,41 @@ +name: Build and Deploy to Netlify +on: + pull_request: +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout your repository using git + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: '' + cache-dependency-path: package-lock.json + + - name: Install + run: | + npm install + + - name: Build + run: | + npm run build + + - name: Deploy to Netlify + uses: nwtgck/actions-netlify@v2.1 + with: + publish-dir: dist + production-branch: master + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: "Preview for #${{ github.event.number }}" + enable-pull-request-comment: true + overwrites-pull-request-comment: true + enable-commit-comment: false + enable-github-deployment: false + alias: deploy-preview-${{ github.event.number }} + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + timeout-minutes: 10 From 474fca158902d776ae5b2dc94c735bf2a7717873 Mon Sep 17 00:00:00 2001 From: phenylshima <49227365+femshima@users.noreply.github.com> Date: Wed, 13 Sep 2023 21:25:54 +0900 Subject: [PATCH 2/2] specify package manager --- .github/workflows/netlify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/netlify.yml b/.github/workflows/netlify.yml index 649b9a4225..29a49db0c9 100644 --- a/.github/workflows/netlify.yml +++ b/.github/workflows/netlify.yml @@ -12,7 +12,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18 - cache: '' + cache: 'npm' cache-dependency-path: package-lock.json - name: Install