From 815613c429017bacd88d87724ffc502f9dafae9a Mon Sep 17 00:00:00 2001 From: Christian Vadala Date: Thu, 15 Aug 2024 17:15:09 +0200 Subject: [PATCH] improves website gh-action --- .github/workflows/website.yml | 49 ++++++++++++++++++++++++++++------- .storybook/main.js | 2 +- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 31620d2..99a2cb1 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -1,16 +1,47 @@ -name: Website +# Simple workflow for deploying static content to GitHub Pages +name: Deploy website on: push: - branches: - - main + branches: ["main"] + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false jobs: - build_and_publish: - name: Publish Github Pages Website - runs-on: ubuntu-22.04 + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: chrvadala/github-actions/gh-pages-publish-action@v1 + - name: Checkout + uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: https://registry.npmjs.org + - name: Install and Build + run: | + npm ci + npm run build --if-present + shell: bash + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + path: './build-website' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.storybook/main.js b/.storybook/main.js index 9b61720..8d245ac 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -2,7 +2,7 @@ module.exports = { staticDirs: ["public"], stories: [ - "./stories/*.mdx", + "./stories/Welcome.mdx", "./stories/*.stories.@(js|jsx|ts|tsx)" ],