-
Notifications
You must be signed in to change notification settings - Fork 71
53 lines (44 loc) · 1.3 KB
/
reusable-node.yml
File metadata and controls
53 lines (44 loc) · 1.3 KB
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
name: Build & Push Node Docker Image
on:
workflow_call:
inputs:
image_name:
required: true
type: string
tag:
required: true
type: string
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '14.16.1'
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Build
working-directory: ./${{inputs.image_name}}
run: |
export NODE_OPTIONS=--max_old_space_size=8192
npm install
npm run-script build
- name: Setup BuildX
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: utmstack
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push the Image
uses: docker/build-push-action@v6
with:
context: /home/runner/work/UTMStack/UTMStack/${{inputs.image_name}}/
push: true
tags: ghcr.io/utmstack/utmstack/${{inputs.image_name}}:${{inputs.tag}}