diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aab09d7..17b6ec1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -85,3 +85,44 @@ jobs: GIT_COMMITTER_NAME: ${{ secrets.GIT_AUTHOR_NAME }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + demo: + if: github.event_name == 'push' && github.ref == 'master' + runs-on: ubuntu-latest + steps: + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Get yarn cache directory path + id: init + shell: bash + run: | + echo "::set-output name=yarn_cache::$(yarn cache dir)" + # + echo "Node $(node --version)" + echo "Yarn $(yarn --version)" + - uses: actions/checkout@v2 + + - name: Cache Yarn packages + id: yarn_cache_packages + uses: actions/cache@v1 + with: + path: ${{ steps.init.outputs.yarn_cache }} + key: ${{ runner.os }}-yarn_cache-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn_cache- + - name: Cache node_modules + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.os }}-${{ matrix.node-version }}-yarn-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.node-version }}-yarn- + + - name: Installing + run: yarn --frozen-lockfile --perfer-offline --link-duplicates + + - name: Deploy demo + run: yarn deploy