cd: add canary deploy #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: '🚀 CD — Publish' | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
id-token: write | |
jobs: | |
canary: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
name: Canary | |
steps: | |
- name: ➕ Actions - Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: main | |
- name: ➕ Actions - Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: ➕ Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: npm-linux-${{ hashFiles('package-lock.json') }} | |
restore-keys: npm-linux- | |
- name: 📦 Installing Dependencies | |
run: npm ci | |
- name: 🚀 Building Poku | |
run: npm run build | |
- name: ⚙️ Git Hash | |
run: | | |
VERSION=$(node -p "require('./package.json').version") | |
SHORT_SHA=$(git rev-parse --short origin/main) | |
echo $SHORT_SHA | |
echo "VERSION=${VERSION}-canary.${SHORT_SHA}" >> $GITHUB_ENV | |
- name: ⬆️ Increment Canary Version | |
run: npm version $VERSION --no-git-tag-version | |
# - name: 📥 Publishing Package | |
# env: | |
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# run: npm publish --tag canary --provenance |