Skip to content

Commit 31ff712

Browse files
committed
fix action
1 parent 5ed79dc commit 31ff712

File tree

2 files changed

+13
-36
lines changed

2 files changed

+13
-36
lines changed

.github/workflows/docker-publish.yml

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,20 @@ jobs:
3232
id-token: write
3333

3434
steps:
35-
- name: Checkout repository
36-
uses: actions/checkout@v4
37-
38-
# Install the cosign tool except on PR
39-
# https://github.com/sigstore/cosign-installer
40-
- name: Install cosign
41-
if: github.event_name != 'pull_request'
42-
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0
43-
with:
44-
cosign-release: 'v2.2.4'
35+
- name: Set up QEMU
36+
uses: docker/setup-qemu-action@v3
4537

46-
# Set up BuildKit Docker container builder to be able to build
47-
# multi-platform images and export cache
48-
# https://github.com/docker/setup-buildx-action
4938
- name: Set up Docker Buildx
50-
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
39+
uses: docker/setup-buildx-action@v3
40+
41+
- name: Checkout repository
42+
uses: actions/checkout@v4
5143

5244
# Login against a Docker registry except on PR
5345
# https://github.com/docker/login-action
5446
- name: Log into registry ${{ env.REGISTRY }}
5547
if: github.event_name != 'pull_request'
56-
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
48+
uses: docker/login-action@v3
5749
with:
5850
registry: ${{ env.REGISTRY }}
5951
username: ${{ github.actor }}
@@ -63,34 +55,19 @@ jobs:
6355
# https://github.com/docker/metadata-action
6456
- name: Extract Docker metadata
6557
id: meta
66-
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
58+
uses: docker/metadata-action@v5
6759
with:
6860
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6961

7062
# Build and push Docker image with Buildx (don't push on PR)
7163
# https://github.com/docker/build-push-action
7264
- name: Build and push Docker image
7365
id: build-and-push
74-
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
66+
uses: docker/build-push-action@v6
7567
with:
7668
context: .
7769
push: ${{ github.event_name != 'pull_request' }}
7870
tags: ${{ steps.meta.outputs.tags }}
7971
labels: ${{ steps.meta.outputs.labels }}
8072
cache-from: type=gha
8173
cache-to: type=gha,mode=max
82-
83-
# Sign the resulting Docker image digest except on PRs.
84-
# This will only write to the public Rekor transparency log when the Docker
85-
# repository is public to avoid leaking data. If you would like to publish
86-
# transparency data even for private images, pass --force to cosign below.
87-
# https://github.com/sigstore/cosign
88-
- name: Sign the published Docker image
89-
if: ${{ github.event_name != 'pull_request' }}
90-
env:
91-
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
92-
TAGS: ${{ steps.meta.outputs.tags }}
93-
DIGEST: ${{ steps.build-and-push.outputs.digest }}
94-
# This step uses the identity token to provision an ephemeral certificate
95-
# against the sigstore community Fulcio instance.
96-
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
FROM amazoncorretto:21-alpine AS builder
2-
ADD ./ /build
2+
ADD . /build
33
WORKDIR /build
4-
CMD ./gradlew build -x test
4+
RUN ./gradlew build -x test
55

66
FROM amazoncorretto:21-alpine
77
WORKDIR /app
8-
COPY --from=builder /build/build/libs/*.jar /app
8+
COPY --from=builder /build/build/libs/backend.jar /app
99
COPY --from=builder /build/resources /app/resources
1010
EXPOSE 8080/tcp
1111
VOLUME /app/resources
12-
ENTRYPOINT java -jar /app/backend.jar
12+
ENTRYPOINT java -jar backend.jar

0 commit comments

Comments
 (0)