From 4083680e8c61e924aa178e80859606322caeb52b Mon Sep 17 00:00:00 2001 From: Muhammad Rivki Date: Mon, 23 Mar 2020 20:35:10 +0700 Subject: [PATCH 1/7] ci: add new jobs for deploy storybook --- .github/workflows/frontend.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 2842442bf9..3769d329a1 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -3,6 +3,8 @@ name: Frontend CI on: pull_request: types: [opened, reopened, edited, synchronize] + push: + branches: master jobs: build: @@ -40,3 +42,25 @@ jobs: yarn test env: CI: true + + jobs: + deoloy-storybook: + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + steps: + - uses: actions/checkout@v2 + - name: build storybook + if: github.event_name === 'push' && github.ref == 'refs/heads/master' + run: | + yarn build-storybook + - name: deploy gh-pages + if: github.event_name === 'push' && github.ref == 'refs/heads/master' + uses: JamesIves/github-pages-deploy-action@3.4.2 + with: + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + BRANCH: gh-pages + FOLDER: packages/core/storybook-static From 2a3b7a0a53060ffafb26b5f5dcc7f507b81949ce Mon Sep 17 00:00:00 2001 From: Muhammad Rivki Date: Mon, 23 Mar 2020 20:41:19 +0700 Subject: [PATCH 2/7] fix: typo --- .github/workflows/frontend.yml | 39 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 3769d329a1..e6521b886c 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -43,24 +43,23 @@ jobs: env: CI: true - jobs: - deoloy-storybook: - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - runs-on: ubuntu-latest + deploy-storybook: + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + runs-on: ubuntu-latest - strategy: - matrix: - node-version: [12.x] - steps: - - uses: actions/checkout@v2 - - name: build storybook - if: github.event_name === 'push' && github.ref == 'refs/heads/master' - run: | - yarn build-storybook - - name: deploy gh-pages - if: github.event_name === 'push' && github.ref == 'refs/heads/master' - uses: JamesIves/github-pages-deploy-action@3.4.2 - with: - ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} - BRANCH: gh-pages - FOLDER: packages/core/storybook-static + strategy: + matrix: + node-version: [12.x] + steps: + - uses: actions/checkout@v2 + - name: build storybook + if: github.event_name === 'push' && github.ref == 'refs/heads/master' + run: | + yarn build-storybook + - name: deploy gh-pages + if: github.event_name === 'push' && github.ref == 'refs/heads/master' + uses: JamesIves/github-pages-deploy-action@3.4.2 + with: + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + BRANCH: gh-pages + FOLDER: packages/core/storybook-static From 184ad42160c927265f6f949d0fb1e9aa4bfb795a Mon Sep 17 00:00:00 2001 From: Muhammad Rivki Date: Mon, 23 Mar 2020 20:42:34 +0700 Subject: [PATCH 3/7] fix: equivalent --- .github/workflows/frontend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index e6521b886c..8cc0dafafd 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -57,7 +57,7 @@ jobs: run: | yarn build-storybook - name: deploy gh-pages - if: github.event_name === 'push' && github.ref == 'refs/heads/master' + if: github.event_name == 'push' && github.ref == 'refs/heads/master' uses: JamesIves/github-pages-deploy-action@3.4.2 with: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} From 9276d42e698b495f0b89d4f92fbdb8575d31e88b Mon Sep 17 00:00:00 2001 From: Muhammad Rivki Date: Mon, 23 Mar 2020 20:43:36 +0700 Subject: [PATCH 4/7] fix: remove unused conditional --- .github/workflows/frontend.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 8cc0dafafd..0cd89f342d 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -52,12 +52,10 @@ jobs: node-version: [12.x] steps: - uses: actions/checkout@v2 - - name: build storybook - if: github.event_name === 'push' && github.ref == 'refs/heads/master' + - name: build storybook' run: | yarn build-storybook - name: deploy gh-pages - if: github.event_name == 'push' && github.ref == 'refs/heads/master' uses: JamesIves/github-pages-deploy-action@3.4.2 with: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} From 6686ca39c5cda4070ef0ea3fe0807eb8823ce522 Mon Sep 17 00:00:00 2001 From: Muhammad Rivki Date: Wed, 25 Mar 2020 01:43:47 +0700 Subject: [PATCH 5/7] ci: add filter trigger only when package/core change --- .github/workflows/frontend.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 0cd89f342d..4b741a917f 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -4,7 +4,10 @@ on: pull_request: types: [opened, reopened, edited, synchronize] push: - branches: master + branches: + - master + paths: + - 'packages/core/src/**' jobs: build: @@ -54,10 +57,11 @@ jobs: - uses: actions/checkout@v2 - name: build storybook' run: | + yarn install yarn build-storybook - name: deploy gh-pages uses: JamesIves/github-pages-deploy-action@3.4.2 with: - ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages FOLDER: packages/core/storybook-static From 8047b853ffa2e27f2dc55d6f00dba2236ef494e8 Mon Sep 17 00:00:00 2001 From: Muhammad Rivki Date: Wed, 25 Mar 2020 01:59:12 +0700 Subject: [PATCH 6/7] fix: update script and ci config --- .github/workflows/frontend.yml | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index bc8e19ccec..e915b64fda 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -66,4 +66,4 @@ jobs: with: ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages - FOLDER: packages/core/storybook-static + FOLDER: packages/storybook/dist diff --git a/package.json b/package.json index 7c6f997efb..b5126e606a 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "test": "cross-env CI=true lerna run test --since origin/master -- --coverage", "create-plugin": "backstage-cli create-plugin", "lint": "lerna run lint", - "storybook": "yarn workspace @spotify-backstage/core storybook", - "build-storybook": "yarn workspace @spotify-backstage/core build-storybook" + "storybook": "yarn workspace storybook start", + "build-storybook": "yarn workspace storybook build-storybook" }, "workspaces": { "packages": [ From 2496a326c0f790bfff12b6ee6bc611ef39d7e2f4 Mon Sep 17 00:00:00 2001 From: Muhammad Rivki Date: Wed, 25 Mar 2020 13:17:32 +0700 Subject: [PATCH 7/7] ci: update token and build command --- .github/workflows/frontend.yml | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index e915b64fda..852d2e28e2 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -60,10 +60,10 @@ jobs: - name: build storybook' run: | yarn install - yarn build-storybook + yarn workspace storybook build-storybook - name: deploy gh-pages uses: JamesIves/github-pages-deploy-action@3.4.2 with: - ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages FOLDER: packages/storybook/dist diff --git a/package.json b/package.json index b5126e606a..7c6f997efb 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "test": "cross-env CI=true lerna run test --since origin/master -- --coverage", "create-plugin": "backstage-cli create-plugin", "lint": "lerna run lint", - "storybook": "yarn workspace storybook start", - "build-storybook": "yarn workspace storybook build-storybook" + "storybook": "yarn workspace @spotify-backstage/core storybook", + "build-storybook": "yarn workspace @spotify-backstage/core build-storybook" }, "workspaces": { "packages": [