-
Notifications
You must be signed in to change notification settings - Fork 33
53 lines (45 loc) · 1.57 KB
/
devkit.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
46
47
48
49
50
51
52
53
name: devkit
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
LATEST_TAG: latest
REGISTRY: ghcr.io/${{ github.repository }}
equeal_with_latest: true
docker_version: "1.16.8"
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set env variables
working-directory: devkit
run: |
image_name=`make repo`
image_tag=`make version`
echo "LOCAL_IMAGE=$image_name:$image_tag" >> $GITHUB_ENV
echo "DEST_IMAGE=${{ env.REGISTRY }}/$image_name:$image_tag" >> $GITHUB_ENV
echo "LATEST_IMAGE=${{ env.REGISTRY }}/$image_name:${{ env.LATEST_TAG }}" >> $GITHUB_ENV
- name: Log in to GitHub Docker Registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull latest csi-baremetal-devkit
run: docker pull ${{ env.LATEST_IMAGE }} || true
- name: Build devkit image
working-directory: devkit
run: make build CACHE_IMAGE=${{ env.LATEST_IMAGE }}
- name: Check equeal with latest
continue-on-error: true
working-directory: devkit
run: |
id1=`docker inspect --format="{{.Id}}" ${{ env.LOCAL_IMAGE }}`
id2=`docker inspect --format="{{.Id}}" ${{ env.LATEST_IMAGE }}`
equeal_with_latest="false"
[ ${id1} == ${id2} ] && equeal_with_latest="true"
echo "equeal_with_latest=${equeal_with_latest}" >> $GITHUB_ENV