Skip to content

Commit d8939cc

Browse files
authored
Merge branch 'master' into sho/docker
2 parents b3efb91 + 7f28a2c commit d8939cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+810
-649
lines changed

.github/workflows/ci.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ jobs:
1515
strategy:
1616
matrix:
1717
java-version: [ 11 ]
18-
node-version: [ 12.x ]
18+
node-version: [ 20.x ]
1919

2020
steps:
2121
# Checkout the repository of both elk and elkjs, place them next to each other.
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
2323
with:
2424
path: elk-live
25-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v4
2626
with:
2727
repository: eclipse/elk-models
2828
path: elk-live/elk-models
@@ -34,19 +34,20 @@ jobs:
3434
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
3535
restore-keys: ${{ runner.os }}-gradle
3636
- name: Cache npm
37-
uses: actions/cache@v1
37+
uses: actions/cache@v4
3838
with:
3939
path: ~/.npm
4040
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json', '**/yarn.lock') }}
4141
restore-keys: ${{ runner.os }}-node-
4242
- name: Set up JDK ${{ matrix.java-version }}
43-
uses: actions/setup-java@v1
43+
uses: actions/setup-java@v4
4444
with:
45+
distribution: 'zulu'
4546
java-version: ${{ matrix.java-version }}
4647
- name: Grant execute permission for gradlew
4748
run: chmod +x $GITHUB_WORKSPACE/elk-live/server/gradlew
4849
- name: Use Node.js ${{ matrix.node-version }}
49-
uses: actions/setup-node@v1
50+
uses: actions/setup-node@v4
5051
with:
5152
node-version: ${{ matrix.node-version }}
5253
# Build client-side code

.github/workflows/publish-docker.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: build-and-publish-docker
2+
3+
# This workflow uses actions that are not certified by GitHub.
4+
# They are provided by a third-party and are governed by
5+
# separate terms of service, privacy policy, and support
6+
# documentation.
7+
8+
on:
9+
push:
10+
branches: ["master"]
11+
12+
pull_request:
13+
branches: ["master"]
14+
15+
env:
16+
# Use docker.io for Docker Hub if empty
17+
REGISTRY: ghcr.io
18+
# github.repository as <account>/<repo>
19+
IMAGE_NAME: ${{ github.repository }}
20+
21+
jobs:
22+
23+
build:
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
packages: write
28+
# This is used to complete the identity challenge
29+
# with sigstore/fulcio when running outside of PRs.
30+
id-token: write
31+
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
# Workaround: https://github.com/docker/build-push-action/issues/461
37+
- name: Setup Docker buildx
38+
uses: docker/setup-buildx-action@v3
39+
40+
# Login against a Docker registry except on PR
41+
# https://github.com/docker/login-action
42+
- name: Log into registry ${{ env.REGISTRY }}
43+
if: github.event_name != 'pull_request'
44+
uses: docker/login-action@v3
45+
with:
46+
registry: ${{ env.REGISTRY }}
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
49+
50+
# Extract metadata (tags, labels) for Docker
51+
# https://github.com/docker/metadata-action
52+
- name: Extract Docker metadata
53+
id: meta
54+
uses: docker/metadata-action@v5
55+
with:
56+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
57+
58+
# Build and push Docker image with Buildx (don't push on PR)
59+
# https://github.com/docker/build-push-action
60+
- name: Build and push Docker image
61+
id: build-and-push
62+
uses: docker/build-push-action@v5
63+
with:
64+
push: ${{ github.event_name != 'pull_request' }}
65+
tags: ${{ steps.meta.outputs.tags }}
66+
labels: ${{ steps.meta.outputs.labels }}
67+
cache-from: type=gha
68+
cache-to: type=gha,mode=max
69+
70+
- name: Clean container registry
71+
uses: actions/delete-package-versions@v5
72+
with:
73+
package-name: "elk-live"
74+
package-type: "container"
75+
min-versions-to-keep: 3
76+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)