-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (39 loc) · 1.19 KB
/
docker-build.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
name: Release
on:
push:
branches:
- main
tags:
- "v*"
env:
IMAGE_NAME: helm
jobs:
# Push image to GitHub Packages.
docker:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Log in to GitHub Package Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Log in to quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_IO_USERNAME }}
password: ${{ secrets.QUAY_IO_PASSWORD }}
- name: Set image tag from Git ref
run: |
# Strip git ref prefix from version
IMAGE_TAG=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && IMAGE_TAG=$(echo $IMAGE_TAG | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$IMAGE_TAG" == "main" ] && IMAGE_TAG=latest
echo "IMAGE_TAG=${IMAGE_TAG}" | tee -a $GITHUB_ENV
- name: Build docker image
run: make docker-build
- name: Push docker image
run: make docker-push