Skip to content

Merge pull request #155 from backstage/topic/v1.17.1 #103

Merge pull request #155 from backstage/topic/v1.17.1

Merge pull request #155 from backstage/topic/v1.17.1 #103

Workflow file for this run

name: Main Master Build
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
env:
CI: true
NODE_OPTIONS: --max-old-space-size=4096
steps:
- uses: actions/checkout@v3
# Beginning of yarn setup
- 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: cache all node_modules
id: cache-modules
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }}
- name: find location of global yarn cache
id: yarn-cache
if: steps.cache-modules.outputs.cache-hit != 'true'
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: cache global yarn cache
uses: actions/cache@v3
if: steps.cache-modules.outputs.cache-hit != 'true'
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: yarn install
run: yarn install --immutable
# End of yarn setup
- name: lint
run: yarn backstage-cli repo lint
- name: type checking and declarations
run: yarn tsc:full
- name: build
run: yarn build
- name: Login to Heroku Container registry
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:login
- name: Build and push
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
DOCKER_BUILDKIT: 1
run: heroku container:push -a ${{ secrets.HEROKU_APP_NAME }} web
- name: Release
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:release -a ${{ secrets.HEROKU_APP_NAME }} web
# Post notification to Discord Announcements channel
- name: 'Check if last commit is a release'
id: check_if_release
run: node scripts/check-if-release.js ${{ github.sha }}
- name: Discord notification
uses: Ilshidur/[email protected]
if: steps.check_if_release.outputs.is_release == 'true'
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
CURRENT_VERSION: ${{ steps.check_if_release.outputs.current_version }}
with:
args: 'The Backstage Demo site has been upgraded to release {{CURRENT_VERSION}} go check it out: https://demo.backstage.io'