-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (38 loc) · 1.26 KB
/
main-job-icr.yml
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
name: Main Image Build and Push
on:
push:
branches: [ "main" ]
# When tested that it works, put restrictions on the paths
paths: ['containers/main-job/**']
env:
IMAGE_NAME: sch-bm-deploy
REGISTRY_URL: us.icr.io
ICR_NAMESPACE: rolling-iaas
ICR_TOKEN: ${{secrets.ICR_TOKEN}}
GITHUB_SHA: ${{ github.sha }}
jobs:
build-and-push-main-job-image:
name: Build and push job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build main code engine container image
id: build-main-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.ICR_NAMESPACE }}/${{ env.IMAGE_NAME }}
tags: latest ${{ env.GITHUB_SHA }}
context: ./containers/main-job
containerfiles: |
./containers/main-job/Dockerfile
- name: Push main code engine image to ICR
id: push-main-image
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-main-image.outputs.image }}
tags: ${{ steps.build-main-image.outputs.tags }}
username: iamapikey
password: ${{ env.ICR_TOKEN }}
registry: ${{ env.REGISTRY_URL }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-main-image.outputs.registry-paths }}"