Cleanup on github actions deploy workflow.

This commit is contained in:
2024-06-30 09:22:18 +12:00
parent 3171641aa8
commit ce5c3b1cff

View File

@ -5,9 +5,6 @@ on:
push: push:
branches: ["main"] branches: ["main"]
# Allows you to run this workflow manually from the actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to gitHub pages # Sets permissions of the GITHUB_TOKEN to allow deployment to gitHub pages
permissions: permissions:
contents: read contents: read
@ -26,17 +23,15 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup node - name: Setup node
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: "20" node-version: "20"
cache: "npm" cache: "npm"
- name: Setup pages - name: Setup pages
uses: actions/configure-pages@v5 uses: actions/configure-pages@v5
with:
# Automatically inject basePath in your Next.js configuration file and disable
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
static_site_generator: next
- name: Restore cache - name: Restore cache
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
@ -47,12 +42,16 @@ jobs:
# If source files changed but packages didn't, rebuild from a prior cache. # If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: | restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies - name: Install dependencies
run: npm install run: npm install
- name: Build with next.js - name: Build with next.js
run: npm run build run: npm run build
- name: nojekyll - name: nojekyll
run: touch ./out/.nojekyll run: touch ./out/.nojekyll
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v3 uses: actions/upload-pages-artifact@v3
with: with: