mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-30 09:57:32 +01:00
97 lines
2.4 KiB
YAML
97 lines
2.4 KiB
YAML
name: Build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
buildApp:
|
|
description: "Include Application Build"
|
|
type: boolean
|
|
default: "true"
|
|
required: true
|
|
buildDoc:
|
|
description: "Include Documentation Build"
|
|
type: boolean
|
|
default: "true"
|
|
required: true
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Use Node.js 16.13.1
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 16.13.1
|
|
cache: "npm"
|
|
|
|
- name: Install NPM dependencies
|
|
run: npm ci
|
|
|
|
- name: Build Production App
|
|
if: ${{ github.event.inputs.buildApp == 'true' }}
|
|
run: npm run build
|
|
- uses: actions/upload-artifact@v3
|
|
if: ${{ github.event.inputs.buildApp == 'true' }}
|
|
with:
|
|
name: app
|
|
path: |
|
|
dist/main.bundle.js
|
|
dist/main.bundle.js.map
|
|
dist/vendor.bundle.js
|
|
dist/vendor.bundle.js.map
|
|
index.html
|
|
expire-on: never
|
|
|
|
- name: Build Documentation
|
|
if: ${{ github.event.inputs.buildDoc == 'true' }}
|
|
run: npm run doc
|
|
- uses: actions/upload-artifact@v3
|
|
if: ${{ github.event.inputs.buildDoc == 'true' }}
|
|
with:
|
|
name: markdown
|
|
path: markdown/
|
|
expire-on: never
|
|
deploy:
|
|
needs: build
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Setup Pages
|
|
uses: actions/configure-pages@v2
|
|
- uses: actions/upload-artifact@v3
|
|
if: ${{ github.event.inputs.buildApp == 'true' }}
|
|
with:
|
|
name: app
|
|
path: |
|
|
dist/main.bundle.js
|
|
dist/main.bundle.js.map
|
|
dist/vendor.bundle.js
|
|
dist/vendor.bundle.js.map
|
|
index.html
|
|
expire-on: never
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v1
|