Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
qtc-de committed Sep 7, 2023
1 parent 8a2f9dc commit a870f4b
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 86 deletions.
64 changes: 0 additions & 64 deletions .github/workflows/build-frontend-dev.yml

This file was deleted.

48 changes: 26 additions & 22 deletions .github/workflows/build-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,37 @@ on:
paths:
- frontend/**
- .github/workflows/build-frontend.yml
pull_request:
branches:
- main
paths:
- frontend/**
- .github/workflows/build-frontend.yml

jobs:
build-online:
build-rpv-web:
runs-on: ubuntu-latest

steps:
- name: Checkout ${{ github.event.repository.name }}
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
- name: Install V
uses: vlang/setup-[email protected]
with:
node-version: '20.x'
version: '0.4'

- name: Build Frontend
working-directory: frontend
- name: Install mingw
run: |
npm install
npm run build
sudo apt install -y gcc-mingw-w64
- name: Build rpv-web
run: |
make
- name: Archive online application
- name: Archive rpv-web
uses: actions/upload-artifact@v3
with:
name: rpv-web-online
path: frontend/dist
name: rpv-web-x64
path: rpv-web-x64.exe

build-offline:
build-frontend:
runs-on: ubuntu-latest
needs: build-rpv-web

steps:
- name: Checkout ${{ github.event.repository.name }}
Expand All @@ -55,10 +52,17 @@ jobs:
working-directory: frontend
run: |
npm install
npm run build -- --mode offline
npm run build
- name: Download rpv-web-x64
uses: actions/download-artifact@v3
with:
name: rpv-web-x64

- name: Archive offline application
- name: Archive frontend and rpv-web
uses: actions/upload-artifact@v3
with:
name: rpv-web-offline
path: frontend/dist
name: rpv-web-x64
path: |
frontend
rpv-web-x64.exe
65 changes: 65 additions & 0 deletions .github/workflows/build-offline-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build Offline Frontend

on:
push:
branches:
- main
paths:
- frontend/**
- .github/workflows/build-offline-frontend.yml

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

concurrency:
group: 'pages'
cancel-in-progress: false

jobs:
build-offline:
runs-on: ubuntu-latest

steps:
- name: Checkout ${{ github.event.repository.name }}
uses: actions/checkout@v3

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

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'

- name: Build Frontend
working-directory: frontend
run: |
npm install
npm run build -- --mode offline
- name: Archive offline frontend
uses: actions/upload-artifact@v3
with:
name: rpv-web-offline
path: 'frontend/dist'

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'frontend/dist'

deploy:
runs-on: ubuntu-latest

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

needs: build-offline

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit a870f4b

Please sign in to comment.