Update chromatic #29
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: Release | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
# For checking out the repository | |
contents: write | |
# For caching | |
actions: write | |
# For configuring AWS credentials | |
id-token: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: blog | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Get pnpm version | |
id: pnpmVersion | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const { readFile } = require('fs/promises'); | |
const rushFile = await readFile('./rush.json'); | |
const config = JSON.parse(rushFile); | |
return config.pnpmVersion; | |
result-encoding: string | |
- name: Install pnpm | |
run: | | |
corepack enable; | |
corepack prepare pnpm@${{steps.pnpmVersion.outputs.result}} --activate; | |
- name: Cache pnpm dependencies | |
uses: actions/cache@v3 | |
with: | |
path: common/temp/pnpm-store | |
key: ${{ runner.os }}-pnpm-v1-${{ hashFiles('common/config/rush/pnpm-lock.yaml') }} | |
- name: Install Packages | |
run: node ../common/scripts/install-run-rush.js install | |
- name: Build | |
run: node ../common/scripts/install-run-rush.js build | |
- name: Test | |
run: node ../common/scripts/install-run-rush.js test --impacted-by git:${{ github.event.before }} | |
- name: Identify on git | |
run: | | |
git config user.email "bot@startup-cto.net" | |
git config user.name "Startup CTO Bot" | |
- name: Configure aws credentials | |
uses: aws-actions/configure-aws-credentials@v1-node16 | |
with: | |
role-to-assume: arn:aws:iam::112125362830:role/GithubDeploymentRole | |
role-session-name: GitHubDeploymentSession | |
aws-region: eu-central-1 | |
- name: Release | |
run: node ../common/scripts/install-run-rush.js release | |
env: | |
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
DEV_TO_API_KEY: ${{ secrets.DEV_TO_API_KEY }} | |
BUTTON_DOWN_API_KEY: ${{ secrets.BUTTON_DOWN_API_KEY }} |