diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2c4308e..4d8d5d7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,31 +1,50 @@ -name: Build and Deploy to GitHub Pages +name: Deploy Svelte site to Pages on: push: - branches: - - wasm + branches: ["wasm"] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false jobs: build: runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v3 + - name: Setup Node + uses: actions/setup-node@v4 with: - node-version: '23' + node-version: "20" + cache: "npm" - - name: Install Dependencies + - name: Install dependencies run: npm install - - name: Build Project + - name: Build with Vite run: npm run build - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./build # Directory to publish \ No newline at end of file + path: ./build + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file