-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (44 loc) · 1.29 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
name: build
on:
push:
branches:
- "*"
tags:
- "v*"
jobs:
buildx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
with:
driver-opts: network=host
- uses: actions/setup-go@v2
with:
go-version: ^1.17
- uses: goreleaser/goreleaser-action@v2
with:
install-only: true
- name: Login to docker.io
uses: docker/login-action@v1
with:
password: ${{ secrets.DOCKER_PASSWORD }}
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
- name: Login to ghcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.CR_PAT }}
registry: ghcr.io
username: ${{ github.repository_owner }}
- name: Build Images
run: |-
export COMMIT_SHA=${{ github.sha }}
export TAG=${COMMIT_SHA:0:7}
export NAMESPACES="docker.io/octohelm ghcr.io/octohelm"
export PUSH=${{ github.event_name != 'pull_request' }}
if [[ ${{ github.ref }} == "refs/tags/v"* ]]; then
export TAG=$(echo ${{ github.ref }} | sed -e "s/refs\/tags\/v//")
fi
make dockerx