-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.03 KB
/
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
name: Build Image
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
concurrency: image-build
jobs:
build-image:
runs-on: ubuntu-latest
environment: image_build
steps:
- name: Parse image tag
id: parse_image_tag
shell: python
run: |
tag = "${{ github.ref_name }}".replace("/", "-")
print(f"::set-output name=image_tag::{tag}")
- name: Echo tag
run: |
echo "${{ steps.parse_image_tag.outputs.image_tag }}"
- name: Login to Quay.io
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Build image
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
tags: quay.io/${{ github.repository }}:${{ steps.parse_image_tag.outputs.image_tag }}