From b82849e6c250ac6600bee7e5cd2180c31a41e4b2 Mon Sep 17 00:00:00 2001 From: Stefan Peters Date: Thu, 3 Feb 2022 12:30:01 +0100 Subject: [PATCH] Add workflow to build Cocoda and deploy to GH Pages as a test (#661) --- .github/workflows/build.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..e76986f3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,33 @@ +name: Build +on: + push: + branches: + - dev + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 16 + uses: actions/setup-node@v1 + with: + node-version: 16.x + # Install Pandoc + - run: sudo apt update && sudo apt install -y pandoc + # Install npm deps and build Cocoda with docs + - run: npm ci + - run: npm run build + # Adjust folder structure for GitHub Pages deployment + - run: mv dist cocoda + - run: mkdir dist-docs + - run: cp docs/index.md dist-docs/ + - run: cp -R cocoda dist-docs/dev + - run: zip -r "cocoda-$(git describe --tags).zip" cocoda + - run: mv "cocoda-$(git describe --tags).zip" dist-docs/ + # Deploy to GitHub Pages + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} + publish_dir: ./dist-docs