Bump actions/upload-pages-artifact from 2 to 3 #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- master | |
name: Deployment | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_PAT }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: ${{ runner.os }}-node- | |
- name: Install dependencies | |
run: npm install | |
- name: Create branch folder | |
run: npm run build | |
- name: Upload GitHub Pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./dist | |
- name: Commit README | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: | | |
Update README | |
[no ci] | |
author_name: Auto5958 | |
author_email: [email protected] | |
add: README.md --force | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
deploy: | |
name: Site Deployment | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |