-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (55 loc) · 2.42 KB
/
docker-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
59
60
61
62
63
64
65
66
67
68
name: Docker Image CI
on:
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: oprypin/find-latest-tag@v1
id: taginfo
with:
repository: keycloak/keycloak-containers
releases-only: false
- uses: octokit/request-action@v2.x
id: get_latest_release
with:
route: GET /orgs/OpenCirclePkgs/packages/container/docker-keycloak/versions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: "echo '${{ steps.get_latest_release.outputs.data }}'"
- run: "echo '${{ steps.get_latest_release.outputs.data[0] }}'"
- run: "echo '${{ steps.get_latest_release.outputs.data[0].id }}'"
- run: "echo '${{ steps.get_latest_release.outputs.data.id }}'"
- run: fromJSON(${{ steps.get_latest_release.outputs.data }})
- run: "echo contains(${{ steps.get_latest_release.outputs.data[0].metadata.container.tags }}, ${{ steps.taginfo.outputs.tag }})"
build_multiarch:
needs: check
runs-on: ubuntu-latest
if: contains(${{ needs.check.get_latest_release.outputs.data[0].metadata.container.tags }}, ${{ needs.check.taginfo.outputs.tag }})
steps:
- run: "echo ${{ needs.check.get_latest_release.outputs.data }}"
- run: "echo ${{ needs.check.get_latest_release.outputs.data[0] }}"
- run: "echo ${{ needs.check.get_latest_release.outputs.data[1] }}"
- run: "echo contains(${{ needs.check.get_latest_release.outputs.data[0].metadata.container.tags }}, ${{ needs.check.taginfo.outputs.tag }})"
- name: Check out Keycloak-Containers
uses: actions/checkout@master
with:
repository: keycloak/keycloak-containers
ref: "${{ steps.taginfo.outputs.tag }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: linux/amd64,linux/arm64
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: build & push image
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
push: true
file: ./server/Dockerfile
context: ./server/
tags: |
${{ steps.taginfo.outputs.tag }}, latest