Skip to content

Commit f3838cc

Browse files
committed
LCORE-311: GH actions release image building from tag
1 parent be7362b commit f3838cc

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build image from a tag and push it to Quay.io
2+
3+
on:
4+
push:
5+
tags:
6+
- '*' # Trigger for all tags
7+
8+
env:
9+
IMAGE_NAME: lightspeed-stack
10+
IMAGE_NAMESPACE: lightspeed-core
11+
REGISTRY: quay.io
12+
GIT_TAG: ${{ github.ref_name }}
13+
LATEST_TAG: latest
14+
CONTAINER_FILE: Containerfile
15+
16+
jobs:
17+
build-and-push-release:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
# Required for image pushing to a registry
22+
packages: write
23+
steps:
24+
- name: Install buildah
25+
run: |
26+
sudo apt update
27+
sudo apt install -y buildah
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
- name: Build image with Buildah
31+
uses: redhat-actions/buildah-build@v2
32+
with:
33+
image: ${{ env.IMAGE_NAME }}
34+
tags: |
35+
${{ env.GIT_TAG }}
36+
${{ env.LATEST_TAG }}
37+
containerfiles: |
38+
${{ env.CONTAINER_FILE }}
39+
oci: true
40+
- name: Push image to Quay.io
41+
uses: redhat-actions/push-to-registry@v2
42+
with:
43+
image: ${{ steps.build_image.outputs.image }}
44+
tags: ${{ steps.build_image.outputs.tags }}
45+
registry: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAMESPACE }}
46+
username: ${{ secrets.QUAY_REGISTRY_USERNAME }}
47+
password: ${{ secrets.QUAY_REGISTRY_PASSWORD }}

0 commit comments

Comments
 (0)