diff --git a/.github/workflows/ci-checks.yaml b/.github/workflows/ci-checks.yaml index 5b235596a..7138cee8c 100644 --- a/.github/workflows/ci-checks.yaml +++ b/.github/workflows/ci-checks.yaml @@ -14,7 +14,7 @@ on: jobs: install-dependencies: - runs-on: ubuntu-latest + runs-on: [default] steps: - uses: actions/checkout@v4 - name: Use Node.js @@ -34,7 +34,7 @@ jobs: run: npm ci reuse-compliance: - runs-on: [ubuntu-latest] + runs-on: [default] steps: - name: Checkout uses: actions/checkout@v4 @@ -44,7 +44,7 @@ jobs: uses: fsfe/reuse-action@v3 license-headers: - runs-on: [ubuntu-latest] + runs-on: [default] steps: - name: Checkout uses: actions/checkout@v4 @@ -61,7 +61,7 @@ jobs: allowed-licenses: needs: install-dependencies - runs-on: ubuntu-latest + runs-on: [default] steps: - uses: actions/checkout@v4 - name: Use Node.js @@ -85,7 +85,7 @@ jobs: lint: needs: install-dependencies - runs-on: ubuntu-latest + runs-on: [default] steps: - uses: actions/checkout@v4 - name: Use Node.js @@ -108,7 +108,7 @@ jobs: format: needs: install-dependencies - runs-on: ubuntu-latest + runs-on: [default] steps: - uses: actions/checkout@v4 - name: Use Node.js @@ -131,7 +131,7 @@ jobs: test: needs: install-dependencies - runs-on: ubuntu-latest + runs-on: [default] steps: - uses: actions/checkout@v4 - name: Use Node.js diff --git a/.github/workflows/deploy-github-pages.yaml b/.github/workflows/deploy-github-pages.yaml index c4ed27fac..986036074 100644 --- a/.github/workflows/deploy-github-pages.yaml +++ b/.github/workflows/deploy-github-pages.yaml @@ -8,7 +8,7 @@ # `{"pull_request": {"number": , "head": {"ref": "", "sha": "PR commit sha"}, "base": {"ref": "main"}}, "repository": {"name": "juno", "owner": {"login": "cloudoperators"}}}` # 2. Run the following command: # `act push --container-architecture linux/amd64 -P default=catthehacker/ubuntu:act-latest -e act_push.json -W .github/workflows/deploy-github-pages.yaml` -name: Storybook +name: Storybook to GitHub Pages on: push: @@ -24,7 +24,7 @@ permissions: jobs: build-and-deploy: - concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession. + concurrency: deploy-gh-pages-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession. runs-on: [default] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/deploy-pr-preview.yaml b/.github/workflows/deploy-pr-preview.yaml new file mode 100644 index 000000000..7251ca17c --- /dev/null +++ b/.github/workflows/deploy-pr-preview.yaml @@ -0,0 +1,42 @@ +name: Storybook PR Preview + +on: + pull_request: + types: + - opened + - reopened + - synchronize + - closed + paths: + - "packages/ui-components/**" + # The paths-ignore option only prevents the workflow from running if all the changed files match the ignore patterns + paths-ignore: + - '**.md' + +# Limit the concurrency of entire workflow +concurrency: deploy-pr-preview-${{ github.ref }} + +jobs: + deploy-preview: + runs-on: [default] + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: "20.x" + + - name: Install dependencies + if: github.event.action != 'closed' + run: | + npm install --force + + - name: Build storybook + run: npm -w @cloudoperators/juno-ui-components run build-storybook + + - uses: rossjrw/pr-preview-action@v1 + with: + source-dir: packages/ui-components/storybook-static + preview-branch: gh-pages + umbrella-dir: pr-preview + action: auto diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index cd6bcc621..ba9860a29 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,7 +14,7 @@ permissions: jobs: release: name: Release - runs-on: ubuntu-latest + runs-on: [default] steps: - name: Checkout Repo uses: actions/checkout@v3