Skip to content

Deploy a Canary Build #155

Deploy a Canary Build

Deploy a Canary Build #155

name: Deploy a Canary Build
on:
workflow_dispatch:
branches-ignore:
- main
jobs:
deploy_canary:
name: Build And Deploy Canary Release
runs-on: ubuntu-latest
environment: canary
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PIPELINE_BOT_PAT }}
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'
- uses: actions/cache@v3
id: node-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-
- run: |
npm i --prefer-offline --no-audit
- name: Set Commitbot Identity
run: |
git config user.name "ES-Components Lerna Publish Bot"
git config user.email "es-components-bot@wtw.org"
- name: Lerna Publish
run: |
echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" > ~/.npmrc
preId=$(git rev-parse --abbrev-ref HEAD | tr "[:upper:]" "[:lower:]")
echo "Publishing a canary release..."
npx lerna publish \
--canary \
--force-publish \
--preid canary-$preId \
--conventional-commits \
--changelog-preset @aabenoja/conventional-changelog-eslint-lerna \
--yes