Open Atharva-Karhale opened 8 months ago
The below mentioned .yml worked for me which uses a newer version of node (i.e. node-version 18 rather than the node-version 16 mentioned in this repo).
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:
deploy: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps:
path: './dist'
wouldn't it be easier to use jekyll?
Updated deployment YAML
name: Deploy
on:
push:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Build project
run: npm run build
- name: Upload production-ready build files
uses: actions/upload-artifact@v3
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@v3
with:
name: production-files
path: ./dist
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
This process worked fine till now but automatically yesterday my website stopped working and there was an error "404".
Also this is the warning displayed on the deploy logs of the GitHub pages "deploy Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/setup-node@v3, actions/configure-pages@v3, actions/upload-artifact@v3, actions/deploy-pages@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/."