Skip to content

Commit 141861a

Browse files
Add GitHub Actions workflow for Docker build and push
1 parent 624a621 commit 141861a

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/docker.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Docker Build & Push
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v3
17+
18+
- name: Login to Docker Hub
19+
uses: docker/login-action@v3
20+
with:
21+
username: ${{ secrets.DOCKERHUB_USERNAME }}
22+
password: ${{ secrets.DOCKERHUB_TOKEN }}
23+
24+
- name: Build and push (latest)
25+
uses: docker/build-push-action@v6
26+
with:
27+
context: ./docker
28+
push: true
29+
tags: jsonviewertool/json-viewer-tool:latest
30+
31+
- name: Sync README to Docker Hub
32+
uses: peter-evans/dockerhub-description@v4
33+
with:
34+
username: ${{ secrets.DOCKERHUB_USERNAME }}
35+
password: ${{ secrets.DOCKERHUB_TOKEN }}
36+
repository: jsonviewertool/json-viewer-tool
37+
readme-filepath: ./README.md

0 commit comments

Comments
 (0)