61 lines
1.7 KiB
YAML
61 lines
1.7 KiB
YAML
name: CI
|
|
|
|
# Controls when the action will run.
|
|
on:
|
|
# Triggers the workflow on push or pull request events but only for the master branch
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
jobs:
|
|
# This workflow contains a single job called "build"
|
|
build:
|
|
# The type of runner that the job will run on
|
|
runs-on: docker
|
|
|
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
steps:
|
|
|
|
- name: Build Release
|
|
if: env.GITHUB_EVENT_NAME == 'push'
|
|
run: echo "BUILD_TYPE=release" >> $GITHUB_ENV
|
|
|
|
- name: Build Debug/Beta
|
|
if: env.GITHUB_EVENT_NAME == 'pull_request'
|
|
run: echo "BUILD_TYPE=debug" >> $GITHUB_ENV
|
|
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
- uses: https://code.forgejo.org/actions/checkout@v2
|
|
name: Checkout Files
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
|
|
- name: Setup node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
cache: 'pnpm'
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: Build site
|
|
run: pnpm run build
|
|
|
|
- name: Upload Build
|
|
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
|
id: upload-build
|
|
with:
|
|
name: Build.zip
|
|
path: './dist'
|
|
retention-days: 3
|
|
overwrite: true
|
|
compression-level: 9 # maximum compression
|