Skip to content

Merge pull request #165 from MadLadSquad/auto #190

Merge pull request #165 from MadLadSquad/auto

Merge pull request #165 from MadLadSquad/auto #190

Workflow file for this run

# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
# 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
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Checkout submodules
shell: bash
run: |
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- uses: actions/setup-node@v4
with:
node-version: '16'
# Disable automatic localhost
- run: "echo 'run-localhost-automatically: false' >> uvproj.yaml"
- run: sudo apt install libyaml-cpp-dev
- name: Build project
run: mkdir build/ && cd UVKBuildTool/ && ./setup-web.sh .. && cd build && ./UVKBuildTool --build ../../build ../../ && cd ../../
- run: ./ci-clean.sh
- run: npm install -g terser
- run: npm install -g csso-cli
- run: npm install -g html-minifier
- run: for i in ./*.js; do terser $i --compress -o $i; done
- run: for i in ./*.css; do csso $i -o $i; done
#- run: for i in ./*.html; do html-minifier [--your-options-here] $i -o $i; done
- name: Change URLs to production mode
run: |
find ./ -type f \( -iname \*.html -o -iname \*.js \) -exec sed -i 's/\/index\.html//g' {} \;
find ./ -type f \( -iname \*.html -o -iname \*.js \) -exec sed -i 's/\.html//g' {} \;
find ./ -type f \( -iname \*.html -o -iname \*.js \) -exec sed -i 's/\.\//https:\/\/youyin.madladsquad.com\//g' {} \;
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4