-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (88 loc) · 3.35 KB
/
deploy.yml
File metadata and controls
107 lines (88 loc) · 3.35 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
permissions:
packages: write
name: Build and publish a Docker image to ghcr.io
on:
# publish on pushes to the main branch (image tagged as "latest")
push:
branches:
- main
- master
env:
REGISTRY: ghcr.io
jobs:
docker_publish_X86:
runs-on: "ubuntu-20.04"
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Read Maven package version
id: maven_version
run: echo "::set-output name=PACKAGE_VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
- name: downcase REPO
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.REPO }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64
tags: |
${{ env.REGISTRY }}/${{ env.REPO }}:${{ steps.maven_version.outputs.PACKAGE_VERSION }}
${{ env.REGISTRY }}/${{ env.REPO }}:latest
build-args: |
GITHUB_ACTOR=${{ github.actor }}
GITHUB_ACCESS_TOKEN=${{ secrets.GITHUB_TOKEN }}
docker_publish_ARM:
runs-on: "ubuntu-20.04"
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Read Maven package version
id: maven_version
run: echo "::set-output name=PACKAGE_VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
- name: downcase REPO
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.REPO }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/arm64
tags: |
${{ env.REGISTRY }}/${{ env.REPO }}:${{ steps.maven_version.outputs.PACKAGE_VERSION }}
${{ env.REGISTRY }}/${{ env.REPO }}:latest
build-args: |
GITHUB_ACTOR=${{ github.actor }}
GITHUB_ACCESS_TOKEN=${{ secrets.GITHUB_TOKEN }}