diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9f6cfc0..c06d99a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,55 +1,51 @@ -name: Deploy to GitHub Pages +name: Deploy + on: push: branches: - master - workflow_dispatch: + jobs: build: + name: Build runs-on: ubuntu-latest + steps: - - name: Checkout - uses: actions/checkout@v4.1.7 - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 9.5.0 - - name: install Nodejs - uses: actions/setup-node@v3 + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Setup Node + uses: actions/setup-node@v1 with: - node-version: 20 - cache: 'pnpm' + node-version: 18 + - name: Install dependencies - run: pnpm install + uses: bahmutov/npm-install@v1 + - name: Build project - run: pnpm run build + run: npm run build + - name: Upload production-ready build files - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-artifact@v2 with: - name: github-pages + name: production-files path: ./dist deploy: + name: Deploy needs: build runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' - permissions: - pages: write - contents: write - id-token: write - actions: read - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v2 with: - name: github-pages + name: production-files path: ./dist + - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist