From ac0d3c7bd49db94426afd0afc9c89ff3e2bdabf4 Mon Sep 17 00:00:00 2001 From: Alexandre Tolstenko Date: Wed, 13 Dec 2023 12:52:11 -0500 Subject: [PATCH] feat: make ci run every commit in order to run multiple hypothesis, but only deploys on master and if the build succeed --- .github/workflows/ci.yml | 50 ++++++++++------------------------------ build-demo.sh | 2 +- 2 files changed, 13 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d48a1a82..1fdbbfb4 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,10 @@ name: ci +# runs on every push to any branch on: push: branches: - - master - tags: - '*' - pull_request: - branches: - - master - workflow_dispatch: jobs: build: @@ -20,14 +15,14 @@ jobs: # - name: Log in to registry # run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin # cache 'upstream' and 'demo/node_modules' folders - - uses: actions/cache@v2 - with: - path: | - upstream - demo/node_modules - build/emsdk_cache - key: ${{ runner.os }}-${{ hashFiles('build/emsdk_cache/sanity.txt') }}-${{ hashFiles('demo/package-lock.json') }} - restore-keys: ${{ runner.os }}-upstream- +# - uses: actions/cache@v2 +# with: +# path: | +# upstream +# demo/node_modules +# build/emsdk_cache +# key: ${{ runner.os }}-${{ hashFiles('build/emsdk_cache/sanity.txt') }}-${{ hashFiles('demo/package-lock.json') }} +# restore-keys: ${{ runner.os }}-upstream- - name: Build run: | @@ -38,12 +33,10 @@ jobs: with: node-version: 16 - - name: Build demo - run: | - ./build-demo.sh - # deploy build/demo to gh-pages - uses: peaceiris/actions-gh-pages@v3 + # runs only on master and if the file build/demo/index.html exists + if: github.ref == 'refs/heads/master' && fileExists('build/demo/index.html') with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./build/demo @@ -57,23 +50,4 @@ jobs: with: name: dist path: ./build.zip - retention-days: 1 - - -# release: -# needs: build -# name: Create Release -# runs-on: ubuntu-latest -# if: startsWith(github.ref, 'refs/tags/') -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/download-artifact@v3 -# - uses: softprops/action-gh-release@v1 -# with: -# files: dist/*.* -# - name: Setup npmrc -# run: | -# echo "@jprendes:registry=https://npm.pkg.github.com/" >> .npmrc -# echo "//npm.pkg.github.com/:_authToken=${{secrets.GITHUB_TOKEN}}" >> .npmrc -# - name: Publish -# run: npm publish + retention-days: 1 \ No newline at end of file diff --git a/build-demo.sh b/build-demo.sh index e07160a8..77eb83b9 100755 --- a/build-demo.sh +++ b/build-demo.sh @@ -5,7 +5,7 @@ export $(cat .env | xargs) SRC=$(dirname $0) -pushd $SRC/demo +pushd $SRC/demo-monaco npm install npm run build popd