Merge pull request #46 from saneci/feature/docker #3
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
name: Continuous Delivery | ||
on: | ||
push: | ||
branches: [ master ] | ||
jobs: | ||
integration-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repository to the runner | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
- name: Run the Maven integration tests | ||
run: mvn clean test | ||
- run: echo "This job's status is ${{ job.status }}." | ||
build: | ||
needs: [integration-tests] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repository to the runner | ||
uses: actions/checkout@v4 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
secret-envs: | ||
db_username: ${{ secrets.DB_USERNAME }} | ||
db_password: ${{ secrets.DB_PASSWORD }} | ||
push: true | ||
target: final | ||
tags: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest |