Skip to content

Commit

Permalink
Add workflow to publish GitHub page
Browse files Browse the repository at this point in the history
Signed-off-by: Giovanni Baratta <[email protected]>
  • Loading branch information
giovannibaratta committed May 15, 2024
1 parent d70b270 commit b788837
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 2 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/deploy-github-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
push:
branches: [ 'main' ]

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

permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'

- name: Yarn install
uses: borales/actions-yarn@v4
with:
cmd: install

- name: Build
uses: borales/actions-yarn@v4
with:
cmd: build

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload dist folder
path: './dist'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
5 changes: 3 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import {defineConfig} from "vite"
import react from "@vitejs/plugin-react"

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
base: "/when-will-i-go-broke/"
})

0 comments on commit b788837

Please sign in to comment.