-
Notifications
You must be signed in to change notification settings - Fork 4
61 lines (53 loc) · 1.76 KB
/
build-release.yml
File metadata and controls
61 lines (53 loc) · 1.76 KB
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
name: Build Release
on:
release:
types:
- published
push:
branches: [ ghactions ]
env:
IMAGE_NAME: preflight-trigger
jobs:
build-release:
name: Build and push tag images
strategy:
matrix:
architecture: [amd64]
platform: [linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set Env Tags
run: echo RELEASE_TAG=$(echo $GITHUB_REF | cut -d '/' -f 3) >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ secrets.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}
# TODO: If we end up releasing for other architectures we'll need the below
# tags: ${{ env.RELEASE_TAG }}-${{ matrix.platform }}-${{ matrix.architecture }}
tags: ${{ env.RELEASE_TAG }}
archs: ${{ matrix.architecture }}
build-args: |
release_tag=${{env.RELEASE_TAG }}
ARCH=${{ matrix.architecture }}
dockerfiles: |
./Dockerfile
- name: Push Image
id: push-image
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ env.IMAGE_NAME }}
# TODO: If we end up releasing for other architectures we'll need the below
# tags: ${{ env.RELEASE_TAG }}-${{ matrix.platform }}-${{ matrix.architecture }}
tags: ${{ env.RELEASE_TAG }}
registry: ${{ secrets.IMAGE_REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-image.outputs.registry-paths }}"
outputs:
imageName: ${{ env.IMAGE_NAME }}
imageVersion: ${{ env.RELEASE_TAG }}