Skip to content

Commit b20b5fd

Browse files
committed
Add 'release-docker' workflow
1 parent f4cc542 commit b20b5fd

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/release-docker.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release Docker Image
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build-and-push:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Docker Buildx
15+
uses: docker/setup-buildx-action@v3
16+
17+
- name: Log in to Docker Hub
18+
uses: docker/login-action@v3
19+
with:
20+
username: ${{ secrets.DOCKERHUB_USERNAME }}
21+
password: ${{ secrets.DOCKERHUB_TOKEN }}
22+
23+
- name: Extract version tag without 'v'
24+
id: set_tag
25+
run: echo "tag=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
26+
27+
- name: Build and push Docker image
28+
uses: docker/build-push-action@v5
29+
with:
30+
context: .
31+
file: ./Dockerfile
32+
push: true
33+
tags: |
34+
yhirose4dockerhub/cpp-httplib-server:latest
35+
yhirose4dockerhub/cpp-httplib-server:${{ steps.set_tag.outputs.tag }}

0 commit comments

Comments
 (0)