-
Notifications
You must be signed in to change notification settings - Fork 9
36 lines (30 loc) · 1.15 KB
/
build-push-images.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
name: Build and push images
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build_push:
runs-on: ubuntu-latest
env:
REGISTRY: quay.io
# Set tag to the last commit sha on main branch, otherwise tag will be the branch name
REGISTRY_TAG: ${{ (github.head_ref||github.ref_name)=='main' && github.sha || (github.head_ref||github.ref_name) }}
REGISTRY_ORG: kubev2v
steps:
- name: Checkout forklift
uses: actions/checkout@v4
- name: Login to quay.io with bot account
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Build and push images to quay.io
run: |
cd ${GITHUB_WORKSPACE}
podman build . -f Containerfile -t $REGISTRY/kubev2v/migration-planner-ui
podman build . -f Containerfile --label "quay.expires-after=10d" -t $REGISTRY/kubev2v/migration-planner-ui:$REGISTRY_TAG
podman push $REGISTRY/kubev2v/migration-planner-ui
podman push $REGISTRY/kubev2v/migration-planner-ui:$REGISTRY_TAG