-
Notifications
You must be signed in to change notification settings - Fork 65
37 lines (32 loc) · 1.14 KB
/
build-push-image-commit.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
name: Build and push godaddy webhook image
on:
pull_request:
branches: [ main ]
push:
branches:
- main
jobs:
build_push_image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Login to Quay.io Hub
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_ROBOT_USER }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
- name: Build the container image
run: |
VERSION=$(git rev-parse --short HEAD 2>/dev/null)
docker build -t cert-manager-webhook-godaddy:${VERSION} -f Dockerfile .
TAG_ID=$(docker images -q cert-manager-webhook-godaddy:${VERSION})
docker tag ${TAG_ID} quay.io/snowdrop/cert-manager-webhook-godaddy:${VERSION}
docker tag ${TAG_ID} quay.io/snowdrop/cert-manager-webhook-godaddy:latest
docker push quay.io/snowdrop/cert-manager-webhook-godaddy:${VERSION}
docker push quay.io/snowdrop/cert-manager-webhook-godaddy:latest