From ed1555c03751f94cef51e6a4bc68a21e5b050525 Mon Sep 17 00:00:00 2001 From: Julian Skinner Date: Fri, 9 Jun 2023 08:08:18 -0500 Subject: [PATCH] feat: add workflows for K8s deployment --- .github/workflows/deploy.yml | 41 --- .github/workflows/lint-test-build.yml | 2 + .github/workflows/release-deploy-v2.yml | 262 ------------------ .github/workflows/release-deploy-v3.yml | 262 ------------------ ...loy-development.yml => release-deploy.yml} | 77 +++-- .github/workflows/tag-release-image.yml | 44 --- docs/Dockerfile | 16 +- docs/config/environments/qa.rb | 2 +- docs/package.json | 1 + packages/sage-assets/Dockerfile | 1 - yarn.lock | 74 ++++- 11 files changed, 140 insertions(+), 642 deletions(-) delete mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/release-deploy-v2.yml delete mode 100644 .github/workflows/release-deploy-v3.yml rename .github/workflows/{deploy-development.yml => release-deploy.yml} (68%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index f596abfcad..0000000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Deploy -on: - workflow_dispatch: -jobs: - deploy: - name: Deploy - runs-on: ubuntu-latest - - steps: - - name: Check out latest - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7.7' - - - name: Set Node Version - uses: actions/setup-node@v3 - with: - node-version: 18.17.1 - - - name: Documentation Site Deploy - env: - HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} - HEROKU_DOCS_APP_NAME: ${{ secrets.HEROKU_DOCS_APP_NAME }} - run: yarn docs:deploy - - - name: Storybook Site Deploy - 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 diff --git a/.github/workflows/lint-test-build.yml b/.github/workflows/lint-test-build.yml index 0243ca0596..4c8174a6c1 100644 --- a/.github/workflows/lint-test-build.yml +++ b/.github/workflows/lint-test-build.yml @@ -1,7 +1,9 @@ name: Lint-Test-Build on: + workflow_call: workflow_dispatch: pull_request: + jobs: lint_test_build: name: Lint, Test, Build diff --git a/.github/workflows/release-deploy-v2.yml b/.github/workflows/release-deploy-v2.yml deleted file mode 100644 index c9a9f275bb..0000000000 --- a/.github/workflows/release-deploy-v2.yml +++ /dev/null @@ -1,262 +0,0 @@ -name: 'Release and Deploy v2' - -on: - # Uncomment the line below if you want to run the workflow manually - # and comment out lines 7-9 - # 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 Node - uses: actions/setup-node@v3 - with: - node-version: 18.17.1 - - - 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: 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') }} - - - 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: Check out latest - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18.17.1 - - - name: Restore Node modules - uses: actions/cache/restore@v3 - id: restore-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') }} - - - name: Install packages - if: steps.restore-sage-lib-node-modules.outputs.cache-hit != true - run: yarn install --frozen-lockfile - - - name: Lint - run: yarn lint - - test: - needs: [setup] - runs-on: ubuntu-latest - - steps: - - name: Check out latest - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18.17.1 - - - name: Restore Node modules - uses: actions/cache/restore@v3 - id: restore-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') }} - - - name: Install packages - if: steps.restore-sage-lib-node-modules.outputs.cache-hit != true - run: yarn install --frozen-lockfile - - - name: Test - run: yarn test - - build: - needs: [setup] - runs-on: ubuntu-latest - - steps: - - name: Check out latest - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18.17.1 - - - name: Restore Node modules - uses: actions/cache/restore@v3 - id: restore-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') }} - - - name: Install packages - if: steps.restore-sage-lib-node-modules.outputs.cache-hit != true - run: yarn install --frozen-lockfile - - - name: Build - run: yarn build - - - name: Cache build assets - uses: actions/cache/save@v3 - id: sage-lib-build-assets - env: - cache-name: sage-lib-build-assets - with: - path: | - 'packages/**' - 'docs/**' - key: ${{ runner.os }}-build-${{ env.cache-name }} - - - publish: - needs: [lint, test, build] - runs-on: ubuntu-latest - - steps: - - name: Check out latest - uses: actions/checkout@v3 - with: - 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: 18.17.1 - - - name: Restore Node modules - uses: actions/cache/restore@v3 - id: restore-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') }} - - - name: Check cache hit - if: steps.restore-sage-lib-node-modules.outputs.cache-hit != 'true' - run: exit 1 - - - 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: 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: Restore Build assets - uses: actions/cache/restore@v3 - id: restore-sage-lib-build-assets - env: - cache-name: sage-lib-build-assets - with: - path: | - 'packages/**' - 'docs/**' - key: ${{ runner.os }}-build-${{ env.cache-name }} - - - name: Check Build Assets cache hit - if: steps.restore-sage-lib-build-assets.outputs.cache-hit != 'true' - continue-on-error: true - run: yarn build - - - 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: Check out latest - uses: actions/checkout@v3 - with: - 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: 18.17.1 - - - 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 diff --git a/.github/workflows/release-deploy-v3.yml b/.github/workflows/release-deploy-v3.yml deleted file mode 100644 index cdb1b1c290..0000000000 --- a/.github/workflows/release-deploy-v3.yml +++ /dev/null @@ -1,262 +0,0 @@ -# Disabling until release-please is resolved -# see .github/workflows/release-please.yml for more information -name: 'Release and Deploy v3 - NOT IN USE' - -on: - workflow_call: - # 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 Node - uses: actions/setup-node@v3 - with: - node-version: 18.17.1 - - - 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: 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') }} - - - 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: Check out latest - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18.17.1 - - - name: Restore Node modules - uses: actions/cache/restore@v3 - id: restore-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') }} - - - name: Install packages - if: steps.restore-sage-lib-node-modules.outputs.cache-hit != true - run: yarn install --frozen-lockfile - - - name: Lint - run: yarn lint - - test: - needs: [setup] - runs-on: ubuntu-latest - - steps: - - name: Check out latest - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18.17.1 - - - name: Restore Node modules - uses: actions/cache/restore@v3 - id: restore-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') }} - - - name: Install packages - if: steps.restore-sage-lib-node-modules.outputs.cache-hit != true - run: yarn install --frozen-lockfile - - - name: Test - run: yarn test - - build: - needs: [setup] - runs-on: ubuntu-latest - - steps: - - name: Check out latest - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18.17.1 - - - name: Restore Node modules - uses: actions/cache/restore@v3 - id: restore-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') }} - - - name: Install packages - if: steps.restore-sage-lib-node-modules.outputs.cache-hit != true - run: yarn install --frozen-lockfile - - - name: Build - run: yarn build - - - name: Cache build assets - uses: actions/cache/save@v3 - id: sage-lib-build-assets - env: - cache-name: sage-lib-build-assets - with: - path: | - 'packages/**' - 'docs/**' - key: ${{ runner.os }}-build-${{ env.cache-name }} - - - publish: - needs: [lint, test, build] - runs-on: ubuntu-latest - - steps: - - name: Check out latest - uses: actions/checkout@v3 - with: - 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: 18.17.1 - - - name: Restore Node modules - uses: actions/cache/restore@v3 - id: restore-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') }} - - - name: Check cache hit - if: steps.restore-sage-lib-node-modules.outputs.cache-hit != 'true' - run: exit 1 - - - 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: 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: Restore Build assets - uses: actions/cache/restore@v3 - id: restore-sage-lib-build-assets - env: - cache-name: sage-lib-build-assets - with: - path: | - 'packages/**' - 'docs/**' - key: ${{ runner.os }}-build-${{ env.cache-name }} - - - name: Check Build Assets cache hit - if: steps.restore-sage-lib-build-assets.outputs.cache-hit != 'true' - continue-on-error: true - run: yarn build - - - name: Lerna Boostrap - run: npx lerna bootstrap --ci - - - name: Lerna Publish - run: npx lerna publish from-package --no-push --registry github --yes - - deploy-sites: - needs: publish - runs-on: ubuntu-latest - - steps: - - name: Check out latest - uses: actions/checkout@v3 - with: - 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: 18.17.1 - - - 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 diff --git a/.github/workflows/deploy-development.yml b/.github/workflows/release-deploy.yml similarity index 68% rename from .github/workflows/deploy-development.yml rename to .github/workflows/release-deploy.yml index bcea871527..158cb6d618 100644 --- a/.github/workflows/deploy-development.yml +++ b/.github/workflows/release-deploy.yml @@ -1,26 +1,33 @@ -name: Deploy-Development +name: Release-Deploy on: # !!Emergency override!! uncomment below and access the actions tab in GitHub to run a release/deploy # workflow_dispatch: push: branches: + - main - develop + - PRODENG-1577/kube_deployment # TODO: Temp for testing + + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + jobs: - release_deploy: - name: Release and Deploy - runs-on: ubuntu-latest - # container: - # image: ruby:2.5.9-alpine3.13 + lint-test-build: + uses: ./.github/workflows/lint-test-build.yml + setup: + needs: [lint-test-build] + runs-on: ubuntu-latest + outputs: + postfix: ${{ env.postfix }} + gitsha: ${{ steps.gitsha.outputs.value }} steps: - # # Setup Auth token to push to github packages - 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 @@ -37,6 +44,11 @@ jobs: - name: Set Bot Name run: git config user.name "Kajabi Automation Bot" + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + version: v0.9.1 + - name: Determine git sha to checkout uses: haya14busa/action-cond@v1 id: gitsha @@ -45,11 +57,23 @@ jobs: if_true: ${{ github.event.pull_request.head.sha }} if_false: ${{ github.sha }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - with: - version: v0.9.1 - + # Envs based on the current branch + - name: Branch Env + id: branch_env + run: | + echo "Running on branch " + if [ "${{ github.ref }}" == "refs/heads/develop" ]; then + echo "postfix=staging" >> $GITHUB_ENV + elif [ "${{ github.ref }}" == "refs/heads/main" ]; then + echo "postfix=production" >> $GITHUB_ENV + else + echo "postfix=staging" >> $GITHUB_ENV + fi + + build_and_push: + needs: [setup] + runs-on: ubuntu-latest + steps: - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: @@ -62,7 +86,9 @@ jobs: - name: Login to Amazon ECR id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 + uses: aws-actions/amazon-ecr-login@v2 + with: + mask-password: true - name: Set branch name if not PR if: github.event_name != 'pull_request' @@ -74,15 +100,18 @@ jobs: - name: Set valid docker tag branch name run: echo "DOCKER_BRANCH_NAME=$(echo $BRANCH_NAME | sed "s/[^[:alnum:]\-\.\_]/-/g")-$GITHUB_RUN_NUMBER" >> $GITHUB_ENV + - name: Checkout uses: actions/checkout@v2 + # Docs Site - name: Build and push docs site uses: docker/build-push-action@v2 env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY_SAGE_DOCS }} - IMAGE_SHA_TAG: ${{ steps.gitsha.outputs.value }} + IMAGE_SHA_TAG: ${{ needs.setup.outputs.gitsha }} + POSTFIX: ${{ needs.setup.outputs.postfix }} with: file: ./docs/Dockerfile build-args: | @@ -90,14 +119,16 @@ jobs: context: ./docs push: true tags: | - ${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY_SAGE_DOCS }}:${{ steps.gitsha.outputs.value }}-release-development + ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_SHA_TAG }}-release-${{ env.POSTFIX }} + # Storybook Site - name: Build and push storybook uses: docker/build-push-action@v2 env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY_SAGE_STORYBOOK }} - IMAGE_SHA_TAG: ${{ steps.gitsha.outputs.value }} + IMAGE_SHA_TAG: ${{ needs.setup.outputs.gitsha }} + POSTFIX: ${{ needs.setup.outputs.postfix }} with: file: ./packages/sage-react/Dockerfile build-args: | @@ -105,14 +136,16 @@ jobs: context: ./packages/sage-react/ push: true tags: | - ${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY_SAGE_STORYBOOK }}:${{ steps.gitsha.outputs.value }}-release-development + ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_SHA_TAG }}-release-${{ env.POSTFIX }} + # Sassdocs Site - name: Build and push sassdocs uses: docker/build-push-action@v2 env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY_SAGE_SASSDOCS }} - IMAGE_SHA_TAG: ${{ steps.gitsha.outputs.value }} + IMAGE_SHA_TAG: ${{ needs.setup.outputs.gitsha }} + POSTFIX: ${{ needs.setup.outputs.postfix }} with: file: ./packages/sage-assets/Dockerfile build-args: | @@ -120,4 +153,4 @@ jobs: context: ./packages/sage-assets/ push: true tags: | - ${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY_SAGE_SASSDOCS }}:${{ steps.gitsha.outputs.value }}-release-development \ No newline at end of file + ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_SHA_TAG }}-release-${{ env.POSTFIX }} diff --git a/.github/workflows/tag-release-image.yml b/.github/workflows/tag-release-image.yml index e95e141157..9d5bbc4858 100644 --- a/.github/workflows/tag-release-image.yml +++ b/.github/workflows/tag-release-image.yml @@ -80,47 +80,3 @@ jobs: dst: | ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY_SAGE_STORYBOOK }}:${{ env.RELEASE_TAG }} ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY_SAGE_STORYBOOK }}:${{ steps.release_tag_suffix.outputs.value }} - # - name: Success Datadog event - # if: success() - # uses: masci/datadog@v1 - # env: - # ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - # ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }} - # RELEASE_TAG: ${{ github.event.inputs.image_tag }}-${{ steps.release_tag_suffix.outputs.value }} - # RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - # with: - # api-key: ${{ secrets.DATADOG_API_KEY }} - # events: | - # - title: "deployment.github_action.tag-release-image" - # text: "%%%\n[GitHub Action Run](${{ env.RUN_URL }})\n%%%" - # alert_type: "success" - # host: "${{ github.runner.name }}" - # tags: - # - "env:${{ github.event.inputs.environment }}" - # - "repository:${{ github.repository }}" - # - "git.commit.sha:${{ github.event.inputs.image_tag }}" - # - "image_name:${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}" - # - "image_tag:${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.RELEASE_TAG }}" - # - "short_image:${{ env.ECR_REPOSITORY }}" - # - name: Failure Datadog event - # if: failure() - # uses: masci/datadog@v1 - # env: - # ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - # ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }} - # RELEASE_TAG: ${{ github.event.inputs.image_tag }}-${{ steps.release_tag_suffix.outputs.value }} - # RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - # with: - # api-key: ${{ secrets.DATADOG_API_KEY }} - # events: | - # - title: "deployment.github_action.tag-release-image" - # text: "%%%\n[GitHub Action Run](${{ env.RUN_URL }})\n%%%" - # alert_type: "error" - # host: "${{ github.runner.name }}" - # tags: - # - "env:${{ github.event.inputs.environment }}" - # - "repository:${{ github.repository }}" - # - "git.commit.sha:${{ github.event.inputs.image_tag }}" - # - "image_name:${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}" - # - "image_tag:${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.RELEASE_TAG }}" - # - "short_image:${{ env.ECR_REPOSITORY }}" \ No newline at end of file diff --git a/docs/Dockerfile b/docs/Dockerfile index feb5ce72e3..e4b9b6ae20 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -8,6 +8,10 @@ ARG NODE_VERSION="16.20.2" ARG YARN_VERSION="1.22.18" ARG ARCH="x64" ARG GITHUB_TOKEN +ARG SECRET_KEY_BASE="foobarbaz" + +ENV SECRET_KEY_BASE=$SECRET_KEY_BASE +ENV RAILS_ENV=$RAILS_ENV RUN apk add \ bash \ @@ -34,28 +38,24 @@ ENV HOME="/app" ENV BUNDLE_PATH="/app/vendor/gems" ENV BUNDLE_APP_CONFIG="/app/.bundle" - -#RUN gem update --system RUN gem install bundler:$BUNDLER_VERSION COPY Gemfile Gemfile.lock ./ -# ISSUE - why is this being run twice... TODO delete -# RUN gem install bundler - RUN if [[ "$RAILS_ENV" == "production" ]]; then bundle config set --local without 'development test'; fi COPY --chown=${NONROOT_UID}:${NONROOT_GID} . . RUN bundle install -RUN echo "-----> Using .npmrc from config " +RUN echo "-----> Using .npmrc from config" +RUN npm config set @kajabi:registry https://npm.pkg.github.com RUN npm config set '//npm.pkg.github.com/:_authToken' '${GITHUB_TOKEN}' +RUN bundle exec rails assets:precompile RUN yarn install --check-files -RUN bundle exec rails assets:precompile SECRET_KEY_BASE=foobarbaz EXPOSE 3000 -CMD ["bundle", "exec", "rails", "s", "-b", "0.0.0.0"] +CMD bundle exec rails s -b 0.0.0.0 -e $RAILS_ENV diff --git a/docs/config/environments/qa.rb b/docs/config/environments/qa.rb index c18eca8aed..d015bd9b91 100644 --- a/docs/config/environments/qa.rb +++ b/docs/config/environments/qa.rb @@ -5,5 +5,5 @@ config.storybook_root_url = "https://sage-lib-storybook.qa.kajabi.farm/?path=/docs/" # Sassdocs deploy url to differentiate in different environments - config.sassdocs_root_url = "https://sage-lib-sassdocs.qa.kajabi.farm/pages/index" + config.sassdocs_root_url = "https://sage-lib-documentation.qa.kajabi.farm/pages/index" end diff --git a/docs/package.json b/docs/package.json index 03126022da..1302eac042 100644 --- a/docs/package.json +++ b/docs/package.json @@ -37,6 +37,7 @@ "dependencies": { "@babel/core": "^7.12.3", "@babel/plugin-transform-runtime": "^7.12.1", + "@babel/plugin-proposal-private-property-in-object": "^7.21.11", "@kajabi/sage-packs": "^1.0.53", "@rails/webpacker": "5.2.2", "arrive": "^2.4.1", diff --git a/packages/sage-assets/Dockerfile b/packages/sage-assets/Dockerfile index 0db40ddb58..0af8061a54 100644 --- a/packages/sage-assets/Dockerfile +++ b/packages/sage-assets/Dockerfile @@ -7,7 +7,6 @@ ARG NODE_VERSION="16.20.2" ARG YARN_VERSION="1.22.18" ARG ARCH="x64" - RUN apk add \ bash \ build-base \ diff --git a/yarn.lock b/yarn.lock index 402d17bca2..934b204bec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -124,6 +124,13 @@ dependencies: "@babel/types" "^7.18.6" +"@babel/helper-annotate-as-pure@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" + integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== + dependencies: + "@babel/types" "^7.22.5" + "@babel/helper-builder-binary-assignment-operator-visitor@^7.18.6": version "7.18.9" resolved "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz" @@ -155,6 +162,21 @@ "@babel/helper-replace-supers" "^7.18.9" "@babel/helper-split-export-declaration" "^7.18.6" +"@babel/helper-create-class-features-plugin@^7.21.0": + version "7.23.9" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.9.tgz#fddfdf51fca28f23d16b9e3935a4732690acfad6" + integrity sha512-B2L9neXTIyPQoXDm+NtovPvG6VOLWnaXu3BIeVDWwdKFgG30oNa6CqVGiJPDWQwIAK49t9gnQI9c6K6RzabiKw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-member-expression-to-functions" "^7.23.0" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.20" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + semver "^6.3.1" + "@babel/helper-create-regexp-features-plugin@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.18.6.tgz" @@ -243,6 +265,13 @@ dependencies: "@babel/types" "^7.18.9" +"@babel/helper-member-expression-to-functions@^7.22.15", "@babel/helper-member-expression-to-functions@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz#9263e88cc5e41d39ec18c9a3e0eced59a3e7d366" + integrity sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA== + dependencies: + "@babel/types" "^7.23.0" + "@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz" @@ -271,6 +300,13 @@ dependencies: "@babel/types" "^7.18.6" +"@babel/helper-optimise-call-expression@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" + integrity sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw== + dependencies: + "@babel/types" "^7.22.5" + "@babel/helper-plugin-utils@7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz" @@ -281,6 +317,11 @@ resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz" integrity sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w== +"@babel/helper-plugin-utils@^7.20.2": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" + integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== + "@babel/helper-remap-async-to-generator@^7.18.6", "@babel/helper-remap-async-to-generator@^7.18.9": version "7.18.9" resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz" @@ -302,6 +343,15 @@ "@babel/traverse" "^7.18.9" "@babel/types" "^7.18.9" +"@babel/helper-replace-supers@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.20.tgz#e37d367123ca98fe455a9887734ed2e16eb7a793" + integrity sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw== + dependencies: + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-member-expression-to-functions" "^7.22.15" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-simple-access@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz" @@ -316,6 +366,13 @@ dependencies: "@babel/types" "^7.18.9" +"@babel/helper-skip-transparent-expression-wrappers@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847" + integrity sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q== + dependencies: + "@babel/types" "^7.22.5" + "@babel/helper-split-export-declaration@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz" @@ -567,6 +624,16 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" +"@babel/plugin-proposal-private-property-in-object@^7.21.11": + version "7.21.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.11.tgz#69d597086b6760c4126525cfa154f34631ff272c" + integrity sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-create-class-features-plugin" "^7.21.0" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-proposal-unicode-property-regex@^7.18.6", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz" @@ -17422,6 +17489,11 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^6.3.1: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + semver@^7.1.1, semver@^7.1.3: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" @@ -20594,4 +20666,4 @@ zwitch@^1.0.0: zxcvbn@^4.4.2: version "4.4.2" resolved "https://registry.npmjs.org/zxcvbn/-/zxcvbn-4.4.2.tgz" - integrity sha512-Bq0B+ixT/DMyG8kgX2xWcI5jUvCwqrMxSFam7m0lAf78nf04hv6lNCsyLYdyYTrCVMqNDY/206K7eExYCeSyUQ== \ No newline at end of file + integrity sha512-Bq0B+ixT/DMyG8kgX2xWcI5jUvCwqrMxSFam7m0lAf78nf04hv6lNCsyLYdyYTrCVMqNDY/206K7eExYCeSyUQ==