write UserControllerTest.java #59
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: [ubuntu-latest] | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Unit Tests | |
run: mvn -B test --file pom.xml | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | |
- name: Build the application | |
run: | | |
mvn clean | |
mvn -B package --file pom.xml | |
- name: Build Docker Image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
dockerfile: Dockerfile | |
push: false | |
tags: ${{ secrets.DOCKER_USERNAME }}/elearning-be | |
- name: Push to Docker Hub | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
dockerfile: Dockerfile | |
push: true | |
tags: ${{ secrets.DOCKER_USERNAME }}/elearning-be |