-
Notifications
You must be signed in to change notification settings - Fork 11
73 lines (63 loc) · 2.67 KB
/
dockerhub_release.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Release - Bump and Publish Version
## Release automation for chainweb-node
# Designed to run systems in chainweb/binary-release
## Currently has manual version setting and creates draft releases;
# when we are confident in this process, it can auto-increment and publish non-drafts
# tbd: connect k8s firing mechanism, create and connect chainweb-node-docker update workflow
run-name: "Release chainweb-node ${{ inputs.release_sha }} from ${{ github.sha}}"
on:
workflow_dispatch:
inputs:
SHORT_SHA:
description: "hash of chainweb-node release, default to branch running this job"
type: string
required: true
VERSION_NEW:
description: "The X.Y.Z tag for the new version"
type: string
required: true
jobs:
Build-Push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: kadena-io/chainweb-node-docker
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PAT }}
- name: Update Dockerfile reference sha
run: |
echo "DOCKERHUB_SHA=not yet updated" >> $GITHUB_ENV
sed -i -e "s/ARG REVISION=.*/ARG REVISION=${{ inputs.SHORT_SHA }}/" Dockerfile
- name: Build and push ubuntu image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: kadena/chainweb-node:${{ inputs.VERSION_NEW }},kadena/chainweb-node:latest
- name: Test run docker image
run: |
docker run --rm kadena/chainweb-node:${{ inputs.VERSION_NEW }} ./chainweb-node --version
- name: Update master branch with dockerfile version
run: |
git config --local user.name "Kadena DevOps"
git config --local user.email "devops@kadena.io"
git add Dockerfile
git commit -m "chainweb-node version bump ${{ inputs.VERSION_NEW }}"
git tag chainweb-${{ inputs.VERSION_NEW }}
git push origin chainweb-${{ inputs.VERSION_NEW }}
- name: Validate SHAs
run: |
## spit these to output
digest1=$(docker inspect kadena/chainweb-node:${{ inputs.VERSION_NEW }} --format '{{ .RepoDigests }}')
digest2=$(docker inspect kadena/chainweb-node:latest --format '{{ .RepoDigests }}')
if [[ $digest1 != $digest2 ]]; then
echo "DOCKERHUB_SHA=sha mismatches in dockerhub image" >> $GITHUB_ENV
exit 1
fi
echo "DOCKERHUB_SHA=$digest1" >> $GITHUB_ENV
echo "DOCKERHUB_SHA=$digest1"