-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (48 loc) · 1.81 KB
/
pr-image.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
name: Build PR Image
on: issue_comment
permissions:
issues: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check for /build_docker_image
id: command
uses: xt0rted/slash-command-action@bf51f8f5f4ea3d58abc7eca58f77104182b23e88 # v2.0.0
with:
command: build_docker_image
reaction: "false"
allow-edits: "false"
permission-level: admin
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{steps.command.outputs.command-arguments }}
- uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4.2.2
with:
distribution: temurin
java-version: 17
- name: Gradle Build
uses: gradle/actions/setup-gradle@@3b1b3b9a2104c2b47fbae53f3938079c00c9bb87 # v3.0.0
with:
arguments: distTar
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v.3.6.1
- name: Set Docker metadata
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
images: target/emoji_manager
tags: type=raw,value=pr-${{ github.event.issue.number }}
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}