-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (79 loc) · 3.17 KB
/
main.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
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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: main
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Download repository
uses: actions/checkout@v2.3.4
- name: Set up QEMU
uses: docker/setup-qemu-action@v1.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1.6.0
- name: Cache Docker layers
uses: actions/cache@v2.1.6
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1.10.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push sdkman image - mvn-3.8.1-jdk-16.0.1.hs-adpt
uses: docker/build-push-action@v2.7.0
with:
context: .
file: ./Dockerfile
build-args: |
JAVA_VERSION=16.0.1.hs-adpt
MAVEN_VERSION=3.8.1
platforms: linux/amd64
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/sdkman:mvn-3.8.1-jdk-16.0.1.hs-adpt
cache-from: ${{ secrets.DOCKERHUB_USERNAME }}/sdkman-cache:mvn-3.8.1-jdk-16.0.1.hs-adpt
cache-to: ${{ secrets.DOCKERHUB_USERNAME }}/sdkman-cache:mvn-3.8.1-jdk-16.0.1.hs-adpt
- name: Build and push sdkman image - mvn-3.8.1-jdk-11.0.11.hs-adpt
uses: docker/build-push-action@v2.7.0
with:
context: .
file: ./Dockerfile
build-args: |
JAVA_VERSION=11.0.11.hs-adpt
MAVEN_VERSION=3.8.1
platforms: linux/amd64
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/sdkman:mvn-3.8.1-jdk-11.0.11.hs-adpt
cache-from: ${{ secrets.DOCKERHUB_USERNAME }}/sdkman-cache:mvn-3.8.1-jdk-11.0.11.hs-adpt
cache-to: ${{ secrets.DOCKERHUB_USERNAME }}/sdkman-cache:mvn-3.8.1-jdk-11.0.11.hs-adpt
- name: Build and push sdkman image - mvn-3.8.1-jdk-8.0.292.hs-adpt
uses: docker/build-push-action@v2.7.0
with:
context: .
file: ./Dockerfile
build-args: |
JAVA_VERSION=8.0.292.hs-adpt
MAVEN_VERSION=3.8.1
platforms: linux/amd64
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/sdkman:mvn-3.8.1-jdk-8.0.292.hs-adpt
cache-from: ${{ secrets.DOCKERHUB_USERNAME }}/sdkman-cache:mvn-3.8.1-jdk-8.0.292.hs-adpt
cache-to: ${{ secrets.DOCKERHUB_USERNAME }}/sdkman-cache:mvn-3.8.1-jdk-8.0.292.hs-adpt
- name: Build and push sample image
uses: docker/build-push-action@v2.7.0
with:
context: ./sample/
file: ./sample/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/bitnami-tomcat9-jdk18-root-war:latest
cache-from: ${{ secrets.DOCKERHUB_USERNAME }}/bitnami-tomcat9-jdk18-root-war-cache:latest
cache-to: ${{ secrets.DOCKERHUB_USERNAME }}/bitnami-tomcat9-jdk18-root-war-cache:latest