Skip to content

Commit

Permalink
ci: modify workflow to deploy to Develop or Staging ECR when push to …
Browse files Browse the repository at this point in the history
…develop (#1874)

Co-authored-by: Julian Skinner <[email protected]>
  • Loading branch information
ju-Skinner and kajabi-bot committed Mar 25, 2024
1 parent d8aad0d commit 218a689
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- develop

jobs:
lint-test-build:
Expand All @@ -17,10 +18,6 @@ jobs:
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: Add safe directory
run: git config --global --add safe.directory /__w/sage-lib/sage-lib

Expand Down Expand Up @@ -53,13 +50,35 @@ jobs:
node-version: 18
registry-url: https://npm.pkg.github.com

# # Setup Auth token to push to github packages
- name: Set NPM Config
run: npm config set '//npm.pkg.github.com/:_authToken=${NPM_TOKEN}'
shell: bash
env:
NPM_TOKEN: ${{ secrets.ACCESS_TOKEN }}

- name: Yarn Install
run: yarn install --frozen-lockfile

- name: Lerna Boostrap
run: yarn lerna bootstrap --ci

- name: Set PreId
id: set_preid
run: |
if [ "${{ github.ref }}" == "refs/heads/develop" ]; then
echo "preid='rc'" >> $GITHUB_OUTPUT
else
echo "preid=''" >> $GITHUB_OUTPUT
fi
- name: Lerna Version Develop
if: github.ref == 'refs/heads/develop'
run: NODE_OPTIONS=--openssl-legacy-provider yarn lerna version prepatch --yes --preid rc

- name: Lerna Publish
run: NODE_OPTIONS=--openssl-legacy-provider yarn lerna publish --registry github --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.ACCESS_TOKEN }}

- name: Deploy Development
if: github.ref == 'refs/heads/develop'
uses: ./.github/workflows/release-deploy
2 changes: 2 additions & 0 deletions .github/workflows/release-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: Release-Deploy
on:
# !!Emergency override!! uncomment below and access the actions tab in GitHub to run a release/deploy
# workflow_dispatch:
workflow_call:
release:
types: [published]


jobs:
lint-test-build:
uses: ./.github/workflows/lint-test-build.yml
Expand Down

0 comments on commit 218a689

Please sign in to comment.