-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (45 loc) · 1.31 KB
/
build-image.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
43
44
45
name: build-image
on:
push:
branches:
- main
paths:
- container/Containerfile
- container/VERSION
- environment.yml
jobs:
build-image:
name: build-image
runs-on: ubuntu-22.04
steps:
- name: Clean up Ubuntu
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get VERSION
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: wri-cities-cif-environment
tags: latest ${{ env.VERSION }} ${{ github.sha }}
containerfiles: |
./Containerfile
- name: Push image to container registry
id: push-image-to-registry
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ghcr.io/wri
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-image-to-registry.outputs.registry-paths }}"