generated from finos/software-project-blueprint
-
Notifications
You must be signed in to change notification settings - Fork 113
61 lines (59 loc) · 2.25 KB
/
manual__publish-docker.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
name: (Manual) Publish Docker
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag (e.g. 1.7.0-rc.1, 0.0.1-beta)'
required: true
default: 'snapshot'
jobs:
manual-publish-docker-image:
# There is currently no way to limit workflow dispatch to only allow default branch
# so we need to restrict it here
# See https://github.community/t/limit-branch-for-workflow-dispatch/122099
if: github.ref == 'refs/heads/master' && github.repository == 'finos/legend-studio'
name: Publish Docker Image
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- image: finos/legend-studio
package: '@finos/legend-application-studio-deployment'
- image: finos/legend-query
package: '@finos/legend-application-query-deployment'
- image: finos/legend-data-cube
package: '@finos/legend-application-data-cube-deployment'
- image: local/legend-showcase-server
package: '@finos/legend-server-showcase-deployment'
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Setup Yarn cache
uses: actions/[email protected]
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Setup Node
uses: actions/[email protected]
with:
node-version: 21
- name: Install dependencies
run: yarn
- name: Check Docker image tag
run: node ./scripts/docker/checkDockerImageTag.js ${{ github.event.inputs.tag }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: finos
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Publish to Docker
run: yarn build && yarn workspace ${{ matrix.package }} publish:docker ${{ github.event.inputs.tag }}
env:
# Webpack build could consume a large amount of memory
NODE_OPTIONS: '--max-old-space-size=4096'