-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (71 loc) · 2.03 KB
/
build.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
name: build
on:
workflow_dispatch:
inputs:
cypress:
description: 'Run cypress'
required: false
type: boolean
default: false
build_docker_image:
description: 'Build docker image'
required: false
type: boolean
default: false
push:
schedule:
- cron: '15 1 * * *'
permissions:
contents: write
id-token: write
jobs:
build:
uses: datavisyn/github-workflows/.github/workflows/build-node-python.yml@new_deployment
secrets: inherit
with:
cypress_enable: true
cypress_run_because_flag: ${{ inputs.cypress == true }}
build-docker:
# needs: [build]
if: inputs.build_docker_image == true
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up node version
uses: actions/setup-node@v3
with:
node-version: '16.16'
- name: Show node and npm version
run: |
corepack enable
node -v
npm -v
shell: bash
- name: Git config
run: |
git config --global url."https://github.com/".insteadOf ssh://[email protected]/
git config --add --global url."https://github.com/".insteadOf [email protected]:
- name: Install dependencies
run: yarn install --no-immutable --inline-builds
shell: bash
- name: Webpack build
run: yarn run webpack:prod
shell: bash
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/jku-vds-lab/reaction-cime
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}