Compare commits

...

4 Commits

2 changed files with 47 additions and 18 deletions

View File

@ -1,18 +1,20 @@
# How the file was made: template used: GitHub's suggested "deploy Nuxt app to GitHub pages"
# Since it's a Vite project, better refer to https://vitejs.dev/guide/static-deploy.html#github-pages
name: Deploy Nuxt site to Pages
name: Deploy and release
on:
# Runs on pushes targeting the default branch
push:
branches: ["webxdc-prototype"]
tags:
- webxdc*
# branches: ["webxdc-prototype"]
# 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
permissions:
contents: read
# Need `contents: write` to make a release.
contents: write
pages: write
id-token: write
@ -23,8 +25,43 @@ concurrency:
cancel-in-progress: false
jobs:
# Build job
build:
release-webxdc:
# Only make a release on tags
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
# TODO refactor: steps are duplicated for both jobs. I think
# YAML can help here.
- name: Checkout
uses: actions/checkout@v3
# https://pnpm.io/continuous-integration
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 7
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build-webxdc
- name: Release
uses: softprops/action-gh-release@v1
with:
# prerelease: ${{ contains(github.event.ref, '-beta') }}
prerelease: true
fail_on_unmatched_files: true
files: dist/*.xdc
# Deploy to GitHub Pages.
deploy-gh-pages:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
@ -39,10 +76,11 @@ jobs:
with:
node-version: "16"
cache: "pnpm"
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Install dependencies
run: pnpm install
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build
env:
REPO_OWNER_AND_NAME: ${{ github.repository }}
@ -53,15 +91,6 @@ jobs:
uses: actions/upload-pages-artifact@v1
with:
path: ./dist
# Deployment job
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@v1

View File

@ -28,7 +28,7 @@
"preview:dev": "vite preview --outDir dist-dev --mode development --port 4173",
"build": "vite build && workbox copyLibraries dist/",
"build-webxdc": "pnpm run build && pnpm run pack-webxdc",
"pack-webxdc": "./generate-webxdc-manifest.sh > dist/manifest.toml && cd dist && cp images/icons/icon-maskable.png icon.png && ../create-xdc.sh",
"pack-webxdc": "./generate-webxdc-manifest.sh > dist/manifest.toml && cd dist && cp images/icons/icon-maskable.png icon.png && ../create-xdc.sh vikunja.xdc",
"build:modern-only": "BUILD_MODERN_ONLY=true vite build && workbox copyLibraries dist/",
"build:dev": "vite build --mode development --outDir dist-dev/",
"lint": "eslint --ignore-pattern '*.test.*' ./src --ext .vue,.js,.ts",