-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.42 KB
/
docker-release.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
37
38
39
40
41
42
43
44
45
46
47
on:
push:
branches:
- "ekw/SRE-1004/release-base-image"
env:
RUST_VERSION: "1.73.0"
GHC_VERSION: "9.6.4"
IMAGE_TAG: rust1.73-ghc9.6.4
jobs:
release-base-image:
runs-on: ubuntu-latest
environment: release
env:
IMAGE_NAME: "concordium/base"
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
DOCKERHUB_TOKEN: ${{secrets.DOCKERHUB_TOKEN}}
steps:
- name: Check if image exist
run: |
set +e
docker manifest inspect ${{env.IMAGE_NAME}}:${{env.IMAGE_TAG}}
exitcode=$?
if [ $exitcode -eq "1" ]; then
echo "Error: ${{env.IMAGE_NAME}}:rust${{env.RUST_VERSION}}-ghc${{env.GHC_VERSION}} already exist"
fi
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }}
- name: Clone repo
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: build docker image
run: |
docker build --build-arg rust_version="${{env.RUST_VERSION}}" --build-arg ghc_version="${{env.GHC_VERSION}}" --label rust_version="${{env.RUST_VERSION}}" --label ghc_version="${{env.GHC_VERSION}}" -f "docker/base.Dockerfile" -t "${{env.IMAGE_NAME}}:${{env.IMAGE_TAG}}" .
- name: Push docker image
run: |
echo ${{env.IMAGE_NAME}}:${{env.IMAGE_TAG}}