changing deploy workflow

This commit is contained in:
Sheldan
2024-03-10 20:28:36 +01:00
parent 1e3b30813a
commit a404aae634
2 changed files with 35 additions and 16 deletions

View File

@@ -1,25 +1,44 @@
name: Execute Build name: Deploy static content to Pages
on: on:
push: push:
branches: branches: ['main']
- master
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: 'pages'
cancel-in-progress: true
jobs: jobs:
build-and-deploy: deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: write
steps: steps:
- uses: actions/checkout@v4 - name: Checkout
- name: Use Node.js uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: '21.x' node-version: 21
cache: 'npm'
- name: Install dependencies - name: Install dependencies
run: | run: npm install
npm ci - name: Build
npx vite build run: npx vite build
- name: Deploy - name: Setup Pages
uses: JamesIves/github-pages-deploy-action@v4 uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with: with:
folder: dist path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

View File

@@ -1,7 +1,7 @@
module.exports = { module.exports = {
root: 'src', root: 'src',
build: { build: {
base: 'https://sheldan.github.io/orbits/', base: '/orbits/',
outDir: '../dist' outDir: '../dist'
} }
} }