-
-
Notifications
You must be signed in to change notification settings - Fork 44
87 lines (76 loc) · 2.44 KB
/
build-docker-standalone-images.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
84
85
86
87
name: build wdi5 docker images
# only run after wdi5/wdio-ui5-service package was released
on:
workflow_run:
workflows: [build and publish wdi5 as wdio-ui5-service to npm]
types:
- completed
# on:
# push:
# branches:
# - main
# paths:
# # relevant
# - "client-side-js/**"
# - "docker/**"
# - "examples/**"
# - "scripts/**"
# - "src/**"
# # don't run on changes to these
# - "!.husky/**"
# - "!.vscode/**"
# - "!docs/**"
# - "!.*"
# - "!*.md"
# - "!*.cjs"
# - "!test/**/*"
jobs:
build:
# only run if building and publishing was successful
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
node_version: [18, 20]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
steps:
- uses: actions/checkout@v3
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
- name: Log in to gh packages registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: |
${{ env.REGISTRY }}/${{ github.repository_owner }}/wdi5
tags: |
type=semver,pattern={{version}},value=${{ steps.package-version.outputs.current-version}}
type=raw,value=node${{ matrix.node_version }}
# - name: show tags + labels
# run: |
# echo ${{ steps.meta.outputs.tags }}
# echo ${{ steps.meta.outputs.labels }}
- name: Build and push wdi5 docker image for node${{ matrix.node_version }}
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/Dockerfile.standalone
build-args: node_version=${{ matrix.node_version }}
push: true
tags: |
${{ env.REGISTRY }}/${{ github.repository_owner }}/wdi5:${{ steps.package-version.outputs.current-version}}-node${{ matrix.node_version }}
# tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}