forked from adoptium/infrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.66 KB
/
build.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
name: Docker
on:
pull_request:
paths:
- .github/workflows/build.yml
- ansible/playbooks/AdoptOpenJDK_Unix_Playbook/**
- ansible/docker/**
branches:
- master
push:
paths:
- .github/workflows/build.yml
- ansible/playbooks/AdoptOpenJDK_Unix_Playbook/**
- ansible/docker/**
branches:
- master
jobs:
build-and-push-centos6:
name: Centos6
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx to use cache feature
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
if: github.ref == 'refs/heads/master'
- name: Docker Build & Push Centos6 Image to Docker Hub
uses: docker/build-push-action@v2
with:
file: ./ansible/docker/Dockerfile.CentOS6
tags: adoptopenjdk/centos6_build_image:latest
cache-from: type=registry,ref=adoptopenjdk/centos6_build_image:latest
cache-to: type=inline
push: ${{ github.ref == 'refs/heads/master' }}
build-and-push-alpine3:
name: Alpine3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx to use cache feature
uses: docker/setup-buildx-action@v2
- name: Docker Build Alpine3 Image
uses: docker/build-push-action@v2
with:
file: ./ansible/docker/Dockerfile.Alpine3
tags: adoptopenjdk/alpine3_build_image:latest
cache-from: type=registry,ref=adoptopenjdk/alpine3_build_image:latest
cache-to: type=inline
push: false