Merge pull request #12 from Typeform/Reorg-codeowners-change-reach-in… #13
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] | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Get yarn cache | |
uses: actions/cache@v3 | |
id: yarn-cache | |
with: | |
path: | | |
**/node_modules | |
~/.cache | |
key: ${{ runner.os }}-repo-${{ github.event.pull_request.head.repo.full_name }}-node-20-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('.github/workflows/**.yml') }} | |
- name: Install Node.js dependencies | |
# run when cache not found or PR is external (build fails for external PRs if dependencies are not installed) | |
if: steps.yarn-cache.outputs.cache-hit != 'true' || github.event.pull_request.head.repo.full_name != github.repository | |
run: yarn install --frozen-lockfile | |
- run: yarn dist | |
env: | |
NODE_ENV: 'production' | |
# update registry and tokens with write access for releasing. | |
- run: rm ./.npmrc | |
- run: npm config set '//registry.npmjs.org/:_authToken' $NPM_TOKEN | |
- run: npm config set '//npm.pkg.github.com/:_authToken' $GH_TOKEN | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
- run: npm config set @typeform:registry https://npm.pkg.github.com/ | |
# install jarvis private package from github | |
- run: yarn add -W @typeform/jarvis | |
- run: git checkout HEAD -- package.json # do not save jarvis dependency to package.json because it is private (the file is committed by semantic-release to bump version) | |
- run: yarn release | |
env: | |
AWS_ASSETS_BUCKET: 'typeform-public-assets/btn' | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} | |
AWS_CLOUDFRONT_DIST: 'E3IUO95IYL1RI3' | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
JARVIS_NOTIFY_PREVIEW_TEMPLATE: ${{ secrets.JARVIS_NOTIFY_PREVIEW_TEMPLATE }} | |
PUBLIC_CDN_URL: 'https://btn.typeform.com' | |
SEGMENT_WRITE_KEY: ${{ secrets.DEPLOYMENT_SEGMENT_WRITE_KEY }} | |
- uses: 8398a7/action-slack@v3 | |
if: failure() | |
with: | |
status: ${{ job.status }} | |
fields: repo,message,commit,author,action | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} |