From d2251a0ab73b63d8c0d195bb24491506d43349af Mon Sep 17 00:00:00 2001 From: Pomax Date: Sun, 7 Jun 2020 16:24:45 -0700 Subject: [PATCH] ci --- .github/workflows/ci.yml | 77 ++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 78 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..9438281c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,77 @@ +name: CI-CD + +on: + push: + branches: + - master + paths: + - 'components/**' + - 'images/**' + - 'lib/**' + - 'stylesheets/**' + - 'tools/**' + - 'changelog.js' + - 'index.template.html' + - 'webpack.config.js' + +jobs: + build: + name: Installing TeX Live and ((Xe)La)TeX related packages + runs-on: ubuntu-latest + shell: bash + steps: + - uses: actions/checkout@master + with: + fetch-depth: 0 + + - name: Installing TeX Live + run: | + sudo apt-get update + sudo apt-get install xzdec libpoppler-glib-dev texlive -y + sudo tlmgr --version + + - name: Installing pdf2svg + run: | + set +e + rm -f *.tar.gz + set -e + wget https://github.com/dawbarton/pdf2svg/archive/v0.2.3.tar.gz + tar -zxf v0.2.3.tar.gz + cd pdf2svg-0.2.3 + ./configure + make + sudo make install + cd .. + set +e + rm -rf pdf2svg-0.2.3 + rm v0.2.3.tar.gz + pdf2svg + set -e + + - name: Installing latest Node + run: | + wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash + sh ~/.nvm/nvm.sh install latest + sh ~/.nvm/nvm.sh use latest + + - name: Installing dependencies + run: | + npm install + echo "finished installing dependencies" + + - name: Running npm build + run: | + echo "running build..." + npm run build:ci + + - name: Push changes + run: | + echo "forming commit..." + git config --local user.email "action@github.com" + git config --local user.name "Bezierinfo CI" + git checkout -b ci-test + git add -A + git commit -m "Automated build" + git push origin ci-test + with: + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index d9041f6e..8125fab9 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "less": "lessc stylesheets/style.less > stylesheets/style.base.css && csso stylesheets/style.base.css > stylesheets/style.css", "prebuild": "node tools/buildmark -- set", "build": "run-s bootstrap build:** default deploy", + "build:ci": "run-s bootstrap build:** default", "postbuild": "node tools/buildmark -- resolve", "build:en-GB": "cross-env LOCALE=en-GB webpack && minify en-GB/article.js -d en-GB", "build:zh-CN": "cross-env LOCALE=zh-CN webpack && minify zh-CN/article.js -d zh-CN",