Skip to content

Commit 7627333

Browse files
committed
Use GHA to build image on tagged release
1 parent 178197a commit 7627333

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Docker Hub
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
- '!v[0-9]+.[0-9]+.[0-9]+[ab][0-9]+'
8+
9+
env:
10+
REPO: csdms/jupyterhub
11+
12+
jobs:
13+
14+
build-and-push:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Get version
19+
id: vars
20+
run: echo "version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
21+
22+
- name: Set up Docker buildx
23+
uses: docker/setup-buildx-action@v3
24+
with:
25+
platforms: linux/amd64,linux/arm64
26+
27+
- name: Login to Docker Hub
28+
uses: docker/login-action@v3
29+
with:
30+
username: ${{ secrets.DOCKERHUB_USERNAME }}
31+
password: ${{ secrets.DOCKERHUB_TOKEN }}
32+
33+
- name: Build and push
34+
uses: docker/build-push-action@v6
35+
with:
36+
platforms: linux/amd64,linux/arm64
37+
push: true
38+
tags: ${{ env.REPO }}:latest,${{ env.REPO }}:${{ steps.vars.outputs.version }}

0 commit comments

Comments
 (0)