From 0922b2db691476e1499a8cf2a9416196b49b960e Mon Sep 17 00:00:00 2001 From: Lucas Bozzo Date: Sun, 7 Jul 2024 20:12:25 +0100 Subject: [PATCH 1/2] Split Github actions files --- .github/workflows/ci.yml | 16 +--------------- .github/workflows/deploy.yml | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 562ca7d..f946582 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - dev pull_request: permissions: @@ -26,18 +27,3 @@ jobs: - run: npm ci - uses: nrwl/nx-set-shas@v4 - deploy: - needs: [main] - runs-on: ubuntu-latest - environment: - name: github-pages - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '16.x' - - uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3 - with: - build_command: npx nx run ui:build-storybook - path: packages/ui/storybook-static - checkout: false diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..81c4e3a --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,25 @@ +name: Deploy + +on: + push: + branches: + - main + workflow_run: + workflows: ['CI'] + types: completed + +jobs: + deploy: + runs-on: ubuntu-latest + environment: + name: github-pages + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3 + with: + build_command: npx nx run ui:build-storybook + path: packages/ui/storybook-static + checkout: false From 9c63fd1c0054cc2553cb5df15d6cd6bb89779f9e Mon Sep 17 00:00:00 2001 From: Lucas Bozzo Date: Sun, 7 Jul 2024 20:18:31 +0100 Subject: [PATCH 2/2] Update pipeline permissions --- .github/workflows/ci.yml | 2 -- .github/workflows/deploy.yml | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f946582..7b25963 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,8 +10,6 @@ on: permissions: actions: read contents: read - pages: write - id-token: write jobs: main: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 81c4e3a..b3469b4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,6 +8,11 @@ on: workflows: ['CI'] types: completed +permissions: + contents: read + pages: write + id-token: write + jobs: deploy: runs-on: ubuntu-latest