| 123456789101112131415161718192021222324252627282930 |
- name: Release
- on:
- push:
- branches: [ main ]
- jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - name: Set up JDK
- uses: actions/setup-java@v3
- with:
- java-version: '17' # or the version you use
- distribution: 'temurin' # or another distribution
- - name: Build with Maven
- run: chmod +x ./mvnw && ./mvnw clean package test
- - name: Build the Docker image
- run: ./mvnw spring-boot:build-image
- - name: Login to Docker Hub
- uses: docker/login-action@v2
- with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
- - name: Push image
- run: docker push stocks-be:0.1
|