Merge pull request #1182 from serlo/chore/fix-tsnode #781
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: Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
update-version: | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.version.outputs.tag }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- id: version | |
uses: salsify/action-detect-and-tag-new-version@v2 | |
with: | |
version-command: | | |
jq ".version" --raw-output < lerna.json | |
docker-image: | |
runs-on: ubuntu-latest | |
needs: update-version | |
if: ${{ needs.update-version.outputs.tag }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: serlo/configure-repositories/actions/setup-node@main | |
- uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: '${{ secrets.GCP_KEY_CONTAINER_REGISTRY }}' | |
- run: gcloud auth configure-docker | |
- uses: google-github-actions/setup-gcloud@v1 | |
- run: yarn deploy:images | |
npm-package: | |
runs-on: ubuntu-latest | |
needs: update-version | |
if: ${{ needs.update-version.outputs.tag }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
cache: yarn | |
node-version-file: .tool-versions | |
registry-url: 'https://registry.npmjs.org' | |
- run: yarn --immutable --immutable-cache | |
- run: yarn build:packages | |
- run: echo //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} > .npmrc | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: yarn lerna publish from-package --yes |