fix the docker workflow

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-12-15 11:37:08 +01:00
parent a3fe6cccf2
commit 759910d97c
+9 -38
View File
@@ -7,6 +7,11 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [16.x]
steps:
- name: checkout
uses: actions/checkout@v3
@@ -14,50 +19,16 @@ jobs:
path: backstage
ref: v${{ github.event.client_payload.version }}
- name: setup-node
uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: https://registry.npmjs.org/
# Beginning of yarn setup, keep in sync between all workflows.
# TODO(Rugvip): move this to composite action once all features we use are supported
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth
# Cache every node_modules folder inside the monorepo
- name: cache all node_modules
id: cache-modules
uses: actions/cache@v3
with:
path: '**/node_modules'
# We use both yarn.lock and package.json as cache keys to ensure that
# changes to local monorepo packages bust the cache.
key: ${{ runner.os }}-v${{ matrix.node-version }}-node_modules-${{ hashFiles('yarn.lock', '**/package.json') }}
# If we get a cache hit for node_modules, there's no need to bring in the global
# yarn cache or run yarn install, as all dependencies will be installed already.
- name: find location of global yarn cache
id: yarn-cache
if: steps.cache-modules.outputs.cache-hit != 'true'
run: echo "dir=$(yarn cache dir)" >> $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
if: steps.cache-modules.outputs.cache-hit != 'true'
run: yarn install --immutable
# End of yarn setup
uses: backstage/actions/yarn-install@v0.5.9
with:
cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }}
- name: create-app
run: npx @backstage/create-app
@@ -65,7 +36,7 @@ jobs:
BACKSTAGE_APP_NAME: example-app
- name: yarn build
run: yarn build
run: yarn build:backend
working-directory: ./example-app
- name: Login to GitHub Container Registry