Merge branch 'main' of https://github.com/nikosnikolaidis/master-test #8
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
name: Docker Image CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml | |
- name: Build the Docker image | |
run: | | |
echo ${{ secrets.DOCKER_TOKEN }} | docker login -u nikosnikolaidis --password-stdin | |
docker build . --file Dockerfile --tag nikosnikolaidis/master-cicd-service:$(date +'%Y-%m-%d') | |
docker push nikosnikolaidis/master-cicd-service:$(date +'%Y-%m-%d') |