-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (39 loc) · 1.07 KB
/
dockerhub.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: build and push docker image
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- 'docker-compose*'
- 'k8s/*'
jobs:
dockerhub:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: check out modulith
uses: actions/checkout@v4
with:
path: './modulith'
- name: set up jdk
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Maven build modulith
run: cd modulith && ./mvnw clean install
- run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Docker build and push (manual)
run: |
echo ${{ env.RELEASE_VERSION }}
cd modulith
docker build -t t2project/modulith:${{ env.RELEASE_VERSION }} .
docker push t2project/modulith:${{ env.RELEASE_VERSION }}