diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..bc1a616 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,47 @@ +name: Deploy Docs +on: + push: + branches: + - main +jobs: + docs: + name: Deploy Docs + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install Node v15 + uses: actions/setup-node@v1 + with: + node-version: 15 + + - name: Install pnpm + run: curl -L https://unpkg.com/@pnpm/self-installer | node + + - name: Use node_modules cache + uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }} + + - name: Install deps + run: pnpm i + + - name: Build the code + run: pnpm run build + + - name: Build the docs + run: pnpm run docs + + - name: Commit the Docs + uses: cpina/github-action-push-to-another-repository@master + env: + API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} + with: + source-directory: 'doc' + destination-github-username: 'github-actions[bot]' + destination-repository-username: "cordis-lib" + destination-repository-name: 'cordis-lib.github.io' + target-branch: 'main' + user-email: 41898282+github-actions[bot]@users.noreply.github.com