-
Notifications
You must be signed in to change notification settings - Fork 47
82 lines (72 loc) · 2.29 KB
/
post-submit.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
name: PostSubmit
on:
push:
branches:
- main
workflow_dispatch: {}
env:
GO_VERSION: '1.22'
jobs:
detect-noop:
runs-on: ubuntu-20.04
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@v5.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
concurrent_skipping: false
image-multi-arch:
runs-on: ubuntu-20.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
arch: [ amd64, arm64 ]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Build Image
run: |
IMG_TAG=latest-${{ matrix.arch }} \
OS=linux \
ARCH=${{ matrix.arch }} \
make docker-build
- name: Push Image
run: |
echo ${{ secrets.DOCKER_PASSWORD }} | docker login --username ${{ secrets.DOCKER_USER }} --password-stdin
docker push oamdev/vela-workflow:latest-${{ matrix.arch }}
docker push oamdev/vela-workflow:latest-${{ matrix.arch }}
image-manifest:
runs-on: ubuntu-latest
needs: [ image-multi-arch ]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Create Manifest
run: |
echo ${{ secrets.DOCKER_PASSWORD }} | docker login --username ${{ secrets.DOCKER_USER }} --password-stdin
docker manifest create oamdev/vela-workflow:latest \
oamdev/vela-workflow:latest-amd64 \
oamdev/vela-workflow:latest-arm64
- name: Annotate Manifest
run: |
docker manifest annotate oamdev/vela-workflow:latest \
oamdev/vela-workflow:latest-amd64 --arch amd64
docker manifest annotate oamdev/vela-workflow:latest \
oamdev/vela-workflow:latest-arm64 --arch arm64
- name: Push Manifest
run: |
docker manifest push oamdev/vela-workflow:latest