Skip to content

Commit c642401

Browse files
release flow
1 parent b0ca51f commit c642401

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,62 @@ jobs:
114114
run: |
115115
rm -rf /tmp/.buildx-cache
116116
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
117+
118+
publish-docker-images:
119+
needs: build-and-release
120+
runs-on: ubuntu-latest
121+
environment: keep-production # Requires release-admin team approval
122+
steps:
123+
- uses: actions/checkout@v4
124+
with:
125+
fetch-depth: 0
126+
127+
- name: Resolve versions
128+
run: |
129+
echo "version=$(git describe --tags --match 'v[0-9]*' HEAD)" >> $GITHUB_ENV
130+
echo "revision=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
131+
echo "dockerhub_org=${DOCKERHUB_ORG:-thresholdnetwork}" >> $GITHUB_ENV
132+
env:
133+
DOCKERHUB_ORG: ${{ secrets.DOCKERHUB_ORG }}
134+
135+
- name: Set up Docker Buildx
136+
uses: docker/setup-buildx-action@v3
137+
138+
- name: Cache Docker layers
139+
uses: actions/cache@v4
140+
with:
141+
path: /tmp/.buildx-cache
142+
key: ${{ runner.os }}-buildx-docker-${{ github.sha }}
143+
restore-keys: |
144+
${{ runner.os }}-buildx-docker-
145+
146+
- name: Login to Docker Hub
147+
uses: docker/login-action@v3
148+
with:
149+
username: ${{ secrets.DOCKERHUB_USERNAME }}
150+
password: ${{ secrets.DOCKERHUB_TOKEN }}
151+
152+
- name: Build and Push Docker Images
153+
uses: docker/build-push-action@v5
154+
with:
155+
target: runtime-docker
156+
tags: |
157+
${{ env.dockerhub_org }}/keep-client:latest
158+
${{ env.dockerhub_org }}/keep-client:${{ env.version }}
159+
${{ env.dockerhub_org }}/keep-client:mainnet
160+
labels: |
161+
version=${{ env.version }}
162+
revision=${{ env.revision }}
163+
build-args: |
164+
ENVIRONMENT=mainnet
165+
VERSION=${{ env.version }}
166+
REVISION=${{ env.revision }}
167+
push: true
168+
cache-from: type=local,src=/tmp/.buildx-cache
169+
cache-to: type=local,dest=/tmp/.buildx-cache-docker-new
170+
context: .
171+
172+
- name: Move Docker cache
173+
run: |
174+
rm -rf /tmp/.buildx-cache
175+
mv /tmp/.buildx-cache-docker-new /tmp/.buildx-cache

0 commit comments

Comments
 (0)