diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 84f46a9..b88f815 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,16 +7,43 @@ on: - main jobs: - build: - name: Build + release: + name: Release runs-on: ubuntu-latest permissions: contents: write steps: - - uses: actions/checkout@v4 + - name: Checkout tools repo + uses: actions/checkout@v4 + with: + repository: Consensys/docs-gha + path: .docs-gha + + - name: Get additional Github env vars # vars from Github env, can not be modified by users + uses: FranzDiebold/github-env-vars-action@v2 + + - name: Read .nvmrc + shell: bash + run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT + id: nvm + + - name: Use Node.js ${{ steps.nvm.outputs.NODE_VERSION }} + uses: actions/setup-node@v4 + with: + node-version: ${{ steps.nvm.outputs.NODE_VERSION }} + registry-url: https://registry.npmjs.org/ + + - name: npm build + shell: bash + run: | + npm ci --only=production + npm run build - - name: Build - uses: Consensys/docs-gha/release@main + - name: Deploy Preview + uses: JamesIves/github-pages-deploy-action@v4 with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + branch: gh-pages + folder: build # The folder the action should deploy. + clean: true + single-commit: true