From 08af607e83f25c818e0772ce45fb4c2416e4f7a1 Mon Sep 17 00:00:00 2001 From: Julian Skinner Date: Fri, 18 Aug 2023 09:51:34 -0500 Subject: [PATCH] Create julian-test.yml --- .github/workflows/julian-test.yml | 118 ++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 .github/workflows/julian-test.yml diff --git a/.github/workflows/julian-test.yml b/.github/workflows/julian-test.yml new file mode 100644 index 0000000000..6f294dc2dc --- /dev/null +++ b/.github/workflows/julian-test.yml @@ -0,0 +1,118 @@ +name: 'Release and Deploy v2' + +on: + workflow_dispatch: + # push: + # branches: + # - main + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +jobs: + setup: + + runs-on: ubuntu-latest + + steps: + - name: Clone Sage-Lib Repo + uses: actions/checkout@v3 + with: + # pulls all commits (needed for lerna / semantic release to correctly version) + fetch-depth: "0" + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7.7' + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 16.20.0 + + - name: Set NPM Config + run: npm config set '//npm.pkg.github.com/:_authToken' '${{ secrets.ACCESS_TOKEN }}' + + - name: Unsafe Perm set + run: npm config set unsafe-perm true + + - name: Add safe directory + run: git config --global --add safe.directory /__w/sage-lib/sage-lib + + - name: Set Bot Email + run: git config user.email "dev+github-bot@kajabi.com" + + - name: Set Bot Name + run: git config user.name "Kajabi Automation Bot" + + - name: Cache Node modules + uses: actions/cache@v3 + id: sage-lib-node-modules + env: + cache-name: sage-lib-node-modules + with: + path: ./node_modules + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}-v1 + + - name: Install packages + if: steps.sage-lib-node-modules.outputs.cache-hit != true + run: yarn install --frozen-lockfile + + lint: + needs: [setup] + runs-on: ubuntu-latest + + steps: + - name: Lint + run: yarn lint + + test: + needs: [setup] + runs-on: ubuntu-latest + + steps: + - name: Test + run: yarn test + + build: + needs: [setup] + runs-on: ubuntu-latest + + steps: + - name: Build + run: yarn build + + publish: + needs: [build] + runs-on: ubuntu-latest + + steps: + - name: Lerna Boostrap + run: npx lerna bootstrap --ci + + - name: Lerna Publish + run: npx lerna publish --registry github --yes + + deploy-sites: + needs: publish + runs-on: ubuntu-latest + + steps: + - name: Deploy Documentation Site + env: + HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} + HEROKU_DOCS_APP_NAME: ${{ secrets.HEROKU_DOCS_APP_NAME }} + run: yarn docs:deploy + + - name: Deploy Storybook Site + env: + HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} + HEROKU_STORYBOOK_APP_NAME: ${{ secrets.HEROKU_STORYBOOK_APP_NAME }} + run: yarn storybook:deploy + + - name: SassDocs Site Deploy + env: + HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} + HEROKU_SASSDOCS_APP_NAME: ${{ secrets.HEROKU_SASSDOCS_APP_NAME }} + run: yarn sassdocs:deploy