Skip to content

Commit 37e726c

Browse files
authored
Create docker (#14)
* Create docker build image and push to docker hub * Update docker multi-arch build
1 parent 813ad65 commit 37e726c

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/docker

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build and Push Docker Image (Multi-Arch)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-push:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v3
19+
20+
- name: Log in to Docker Hub
21+
uses: docker/login-action@v3
22+
with:
23+
username: ${{ secrets.DOCKERHUB_USERNAME }}
24+
password: ${{ secrets.DOCKERHUB_TOKEN }}
25+
26+
- name: Build and push Docker image (multi-arch)
27+
uses: docker/build-push-action@v5
28+
with:
29+
context: .
30+
file: ./Dockerfile
31+
push: true
32+
platforms: linux/amd64,linux/arm64
33+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/weather-app-java:latest

0 commit comments

Comments
 (0)