-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (67 loc) · 2.25 KB
/
push.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
name: 🔍 Go for Push
on:
push:
branches: [ main ]
jobs:
job0:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Prepare
id: prepare
run: |
TAG=${GITHUB_REF#refs/tags/}
echo ::set-output name=tag_name::${TAG}
- name: set up buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_TOKEN }}
- name: build (and publish) main image
env:
# fork friendly ^^
DOCKER_REPO: ghcr.io/${{ github.repository_owner }}/automq-operator
run: |
IMG=${DOCKER_REPO}:latest make docker-buildx
job1:
runs-on: ubuntu-20.04
needs: job0
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Verify sealos
run: |
curl -sfL https://raw.githubusercontent.com/labring/sealos/v5.0.0/scripts/install.sh | sh -s v5.0.0 labring/sealos
- name: build
run: |
go run gen/version/gen.go ghcr.io/${{ github.repository_owner }}/automq-operator:latest && make info
cd deploy
IMAGE_NAME="ghcr.io/${{ github.repository_owner }}/automq-operator-sealos:latest"
sudo sealos build -t "${IMAGE_NAME}"-amd64 --platform linux/amd64 . && sudo rm -rf registry
sudo sealos build -t "${IMAGE_NAME}"-arm64 --platform linux/arm64 . && sudo rm -rf registry
sudo sealos login -u ${{ github.repository_owner }} -p ${{ secrets.GH_TOKEN }} --debug ghcr.io
bash manifest.sh ${IMAGE_NAME}
sync:
runs-on: ubuntu-20.04
needs: job1
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: build
run: |
gh issue comment ${{ vars.SEALOS_ISSUE_NUMBER }} --body "/imagebuild_apps automq-operator latest" --repo ${{ vars.SEALOS_ISSUE_REPO }}