From 965b6d36da3230ad7508fc10e8f2848e017bb815 Mon Sep 17 00:00:00 2001 From: wan Date: Wed, 25 Oct 2023 14:38:18 -0300 Subject: [PATCH] =?UTF-8?q?:sparkles:=20Configura=C3=A7=C3=A3o=20do=20GH?= =?UTF-8?q?=20Pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/doc-publish.yml | 51 ++++++++++++++++++++----------- package.json | 4 ++- 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/.github/workflows/doc-publish.yml b/.github/workflows/doc-publish.yml index 7e53a0f..e6a3984 100644 --- a/.github/workflows/doc-publish.yml +++ b/.github/workflows/doc-publish.yml @@ -1,30 +1,45 @@ -name: Publish Docs in Git Pages - +name: Deploy Docs on: workflow_run: workflows: ["Publish on Github"] types: - completed + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false jobs: - publish: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} permissions: write-all runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v3 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - node-version: '18' - - - name: Install dependencies and build - run: npm install && npm run build - - - name: Deploy with gh-pages + node-version: "18" + - uses: actions/configure-pages@v3 + - name: Build run: | - git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git - npm run deploy-storybook -- -u "github-actions-bot " - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + npm install + npm run deploy-storybook + echo "react-css.squidit.com.br" > CNAME + cd .storybook-static + echo "react-css.squidit.com.br" > CNAME + + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: ".storybook-static/" + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/package.json b/package.json index a9c88c1..61623b8 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,9 @@ "test-watch": "vitest", "test:ui": "vitest --ui", "storybook": "storybook dev -p 6006", - "build-storybook": "storybook build" + "build-storybook": "storybook build", + "pre-deploy": "npm run build-storybook", + "deploy-storybook": "npm run pre-deploy && touch ./storybook-static/.nojekyll" }, "lint-staged": { "*.{ts,tsx}": [