From 119577add61ad7e84c4632bd67deca42b10d2f0f Mon Sep 17 00:00:00 2001 From: ydah Date: Sat, 11 Jan 2025 10:18:22 +0900 Subject: [PATCH] Add GitHub Actions workflow for Nuxt.js deployment to GitHub Pages --- .github/workflows/build.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..386212c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: Nuxt generate and deploy to GitHub Pages +on: + push: + branches: + - main +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: 'npm' + - run: npm install + - run: npm run generate + - name: deploy + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.ref == 'refs/heads/main' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist