-
Notifications
You must be signed in to change notification settings - Fork 233
83 lines (70 loc) · 2.81 KB
/
master.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
# Beginning of yarn setup
- name: use node.js 20.x
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 20.x
registry-url: https://registry.npmjs.org/ # Needed for auth
- name: cache all node_modules
id: cache-modules
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
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@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
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:all
- 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/action-discord@0c4b27844ba47cb1c7bee539c8eead5284ce9fa9 # 0.3.2
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'