Skip to content

Commit

Permalink
simple build and deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rlindner81 committed Oct 3, 2024
1 parent 35046aa commit fbad773
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 4 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
# This workflow will build and deploy new commits with changes in docs directory to GitHub pages

name: Build and Deploy

on:
workflow_dispatch:
push:
branches: [main]
paths:
- src/**
- public/**

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

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

jobs:
build:
runs-on: ubuntu-latest
if: github.repository_owner == 'rlindner81' # don't build on forks
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build
run: |
npm ci --package-lock
npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist/spa

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"private": true,
"name": "littlehome",
"version": "0.0.1",
"description": "Little Home",
"productName": "Little Home",
"author": "Richard Lindner <[email protected]>",
"scripts": {
"dev": "quasar dev",
"build": "quasar build"
"dev": "npx quasar dev",
"build": "npx quasar build"
},
"dependencies": {
"@quasar/extras": "^1.16.4",
Expand Down

0 comments on commit fbad773

Please sign in to comment.