diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 36df373..ddc6058 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,51 +1,45 @@ -name: Deploy +name: Deploy static content to Pages on: push: branches: - main + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: true + jobs: - build: - name: Build + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - - name: Setup Node - uses: actions/setup-node@v1 + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Node + uses: actions/setup-node@v3 with: node-version: 18 - + cache: "npm" - name: Install dependencies - uses: bahmutov/npm-install@v1 - - - name: Build project + run: npm install + - name: Build run: npm run build - - - name: Upload production-ready build files - uses: actions/upload-artifact@v2 + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 with: - name: production-files - path: ./dist - - deploy: - name: Deploy - needs: build - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' - - steps: - - name: Download artifact - uses: actions/download-artifact@v2 - with: - name: production-files - path: ./dist - + path: "./dist" - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./dist + id: deployment + uses: actions/deploy-pages@v2