-
Notifications
You must be signed in to change notification settings - Fork 21
89 lines (72 loc) · 2.26 KB
/
on_push_to_main.yaml
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
on:
push:
branches:
- main
env:
FS_IMAGE: ghcr.io/${{ github.repository }}
jobs:
release-docker:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
strategy:
matrix:
platform:
# - { earthly: linux/arm64, suffix: linux-arm64 }
- { earthly: linux/amd64, suffix: linux-amd64 }
steps:
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1
with:
image: tonistiigi/binfmt:latest
platforms: all
if: matrix.platform == 'linux/arm64'
- uses: actions/checkout@v3
- uses: wistia/[email protected]
- uses: earthly/actions-setup@v1
with: { version: "v${{ env.EARTHLY_TOOL_VERSION }}" }
- name: extract sha
run: |
echo "GIT_COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "GIT_TAG=$(git describe)" >> $GITHUB_ENV
- name: login to registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push the Docker image
run: |
earthly \
--platform ${{ matrix.platform.earthly }} \
--push \
+docker-dev \
--HELM_VERSION=${{ env.HELM_TOOL_VERSION }} \
--KUSTOMIZE_VERSION=${{ env.KUSTOMIZE_TOOL_VERSION }} \
--GIT_TAG=${{ env.GIT_TAG }} \
--GIT_COMMIT=${{ env.GIT_COMMIT }} \
--CI_REGISTRY_IMAGE=${{ env.FS_IMAGE }}
release-multiarch:
runs-on: ubuntu-22.04
needs:
- release-docker
permissions:
packages: write
steps:
- name: extract sha
run: |
echo "GIT_COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: login to registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: int128/docker-manifest-create-action@v1
with:
tags: ghcr.io/${{ github.repository_owner }}/kubechecks:${{ env.GIT_RELEASE_TAG }}
suffixes: |
-linux-amd64
# -linux-arm64