Skip to content

Commit 1583ca8

Browse files
committed
feat: publish the JSP docker image via github
For #1007
1 parent 27875cb commit 1583ca8

File tree

1 file changed

+39
-6
lines changed

1 file changed

+39
-6
lines changed

.github/workflows/build-jsp.yml

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@ name: Build JSP
33
env:
44
CURRENT_UVERSION: 17.0.0 # FIX_FOR_NEW_VERSION
55
PREVIOUS_UVERSION: 16.0.0 # not used at present
6+
REGISTRY: ghcr.io
7+
IMAGE_NAME: ${{ github.repository }}
68

79
on:
8-
push:
9-
branches:
10-
- '*'
1110
pull_request:
1211
branches:
1312
- '*'
13+
push:
14+
tags:
15+
- '*'
1416
jobs:
1517
build:
1618
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
packages: write
22+
attestations: write
23+
id-token: write
1724
steps:
1825
- uses: actions/checkout@v3
1926
- name: Get the CLDR_REF from pom.xml
@@ -73,6 +80,32 @@ jobs:
7380
with:
7481
name: UnicodeJsps
7582
path: UnicodeJsps/target/UnicodeJsps.war
76-
- name: build docker image
77-
run: cd UnicodeJsps && bash update-bidic-ucd.sh && docker build .
78-
83+
- name: Build C Bidi
84+
run: cd UnicodeJsps && bash update-bidic-ucd.sh
85+
- name: Log in to the Container registry
86+
if: github.event_name != 'pull_request'
87+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
88+
with:
89+
registry: ${{ env.REGISTRY }}
90+
username: ${{ github.actor }}
91+
password: ${{ secrets.GITHUB_TOKEN }}
92+
- name: Extract metadata (tags, labels) for Docker
93+
id: meta
94+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
95+
with:
96+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
97+
- name: Build and push Docker image
98+
id: push
99+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
100+
with:
101+
context: UnicodeJsps/
102+
push: true
103+
tags: ${{ steps.meta.outputs.tags }}
104+
labels: ${{ steps.meta.outputs.labels }}
105+
- name: Generate artifact attestation
106+
if: github.event_name != 'pull_request'
107+
uses: actions/attest-build-provenance@v2
108+
with:
109+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
110+
subject-digest: ${{ steps.push.outputs.digest }}
111+
push-to-registry: true

0 commit comments

Comments
 (0)