Skip to content

Commit

Permalink
Commit message: Update vite.config.ts and .github/workflows/pages.yml…
Browse files Browse the repository at this point in the history
… for deployment to GitHub Pages
  • Loading branch information
PandeCode committed Mar 3, 2023
1 parent b890a85 commit 641c03a
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 17 deletions.
65 changes: 48 additions & 17 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,51 @@
name: Build and Deploy
on: [push]
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
contents: read
pages: write
id-token: write

- name: Install and Build
run: |
npm install
npm run build
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist # The folder the action should deploy.
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload dist repository
path: "./dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { VitePWA } from "vite-plugin-pwa";

// https://vitejs.dev/config/
export default defineConfig({
base: "/anode/",
plugins: [
react(),
VitePWA({
Expand Down

0 comments on commit 641c03a

Please sign in to comment.