Skip to content

Deploy Nightly Release #61

Deploy Nightly Release

Deploy Nightly Release #61

name: Deploy Nightly Release
on:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
jobs:
build:
if: github.repository == 'backstage/backstage' # prevent running on forks
runs-on: ubuntu-latest
env:
CI: true
NODE_OPTIONS: --max-old-space-size=4096
steps:
- uses: actions/checkout@v3
- name: use node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/ # Needed for auth
- name: yarn install
uses: backstage/actions/[email protected]
with:
cache-prefix: ${{ runner.os }}-v18.x
# No verification done here, only build & publish. If the master branch
# is broken we will see that from those builds, but we still want to push nightly
# builds since upgrading to them is a manual process anyway.
- name: tsc
run: yarn tsc
- name: build
run: yarn backstage-cli repo build
- name: build embedded techdocs app
working-directory: packages/techdocs-cli-embedded-app
run: yarn build
# Prepares a nightly release version of any package with pending changesets
# Pre-mode is exited if case we're in it, otherwise it has no effect
- name: prepare nightly release
run: |
yarn changeset pre exit || true
yarn changeset version --snapshot nightly
# Publishes the nightly release to npm, by using tag we make sure the release is
# not flagged as the latest release, which means that people will not get this
# version of the package unless requested explicitly
- name: publish nightly release
run: |
yarn config set -H 'npmAuthToken' "${{secrets.NPM_TOKEN}}"
yarn workspaces foreach -p -j 10 -v --no-private npm publish --access public --tolerate-republish --tag nightly
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Discord notification
if: ${{ failure() }}
uses: Ilshidur/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: 'Nightly build failed https://github.com/{{GITHUB_REPOSITORY}}/actions/runs/{{GITHUB_RUN_ID}}'