From 5a99c07cc792cbb6563b1a82ecbb40624315ea85 Mon Sep 17 00:00:00 2001 From: Jan Dvorak Date: Tue, 12 Oct 2021 11:10:27 +0200 Subject: [PATCH] Netlify deploy script --- .github/workflows/docs.yml | 68 ++++++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a37ccabc53..ad8c32d4ad 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,12 +20,66 @@ jobs: node-version: 12.x - run: npm ci - run: npm build - deploy: + preview: runs-on: ubuntu-latest defaults: run: working-directory: docs/ - needs: [test] + needs: [ test ] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: Build the Guide + run: npm ci && npm run build + - name: Deploy to Netlify for preview + uses: nwtgck/actions-netlify@v1.2.2 + with: + publish-dir: './docs/public' + production-branch: devel + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: "Deploy from GitHub Actions" + netlify-config-path: './docs/netlify.toml' + alias: ${{ github.event.number }} + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_GUIDE_SITE_ID }} + deploy-branch: + runs-on: ubuntu-latest + defaults: + run: + working-directory: guide/site/ + needs: [ test ] + if: + contains(' + refs/heads/release- + ', github.ref) + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: Build the Guide + run: npm ci && npm run build + - name: Deploy to Netlify for preview + uses: nwtgck/actions-netlify@v1.2.2 + with: + publish-dir: './docs/public' + production-branch: devel + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: "Deploy from GitHub Actions" + netlify-config-path: './docs/netlify.toml' + alias: ${{ github.head_ref }} + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_GUIDE_SITE_ID }} + deploy: + runs-on: ubuntu-latest + defaults: + run: + working-directory: guide/site/ + needs: [ test ] if: contains(' refs/heads/devel @@ -36,14 +90,16 @@ jobs: - uses: actions/setup-node@v1 with: node-version: 12.x - - name: Deploy to Netlify + - name: Build the Guide + run: npm ci && npm run build + - name: Deploy to Netlify for preview uses: nwtgck/actions-netlify@v1.2.2 with: - publish-dir: './dist' + publish-dir: './docs/public' production-branch: devel github-token: ${{ secrets.GITHUB_TOKEN }} deploy-message: "Deploy from GitHub Actions" - netlify-config-path: './netlify.toml' + netlify-config-path: './docs/netlify.toml' env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DOCS_SITE_ID }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_GUIDE_SITE_ID }}