CI: create a platform-agnostic script for any CI system

This commit is contained in:
liushuyu 2021-06-08 01:40:42 -06:00
parent 9ff19990d3
commit 1d9af000b1
No known key found for this signature in database
GPG key ID: 23D1CE4534419437
2 changed files with 14 additions and 11 deletions

12
.ci/build.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash -ex
echo -e '\e[1m\e[36m========== Installing gulp & dependencies ==========\e[0m'
yarn install
# Install dependencies one-by-one to avoid race-conditions
yarn --cwd ./scripts/shared-hugo-scripts/wiki/
yarn --cwd ./scripts/shared-hugo-scripts/compatdb/
yarn hugo version
echo -e '\e[1m\e[36m========== Starting gulp deploy task ===============\e[0m'
yarn run build
echo -e '\e[1m\e[32m Success! Site deployed to `build` folder.\e[0m'

View file

@ -18,21 +18,12 @@ jobs:
with: with:
submodules: true submodules: true
- name: Install dependencies - name: Install dependencies
run: | run: sudo apt-get install graphicsmagick
echo '========== Installing gulp & dependencies =========='
sudo apt-get install graphicsmagick
yarn install
# Install dependencies one-by-one to avoid race-conditions
pushd ./scripts/shared-hugo-scripts/wiki/ && yarn && popd
pushd ./scripts/shared-hugo-scripts/compatdb/ && yarn && popd
yarn hugo version
- name: Build - name: Build
env: env:
GITHUB_WIKI_URL: 'https://github.com/yuzu-emu/yuzu.wiki.git' GITHUB_WIKI_URL: 'https://github.com/yuzu-emu/yuzu.wiki.git'
TENANT: 'yuzu' TENANT: 'yuzu'
run: | run: ./.ci/build.sh
echo '========== Starting gulp deploy task =========='
yarn run build
- name: Deploy - name: Deploy
if: ${{ ! github.base_ref }} if: ${{ ! github.base_ref }}
uses: JamesIves/github-pages-deploy-action@3.7.1 uses: JamesIves/github-pages-deploy-action@3.7.1