CI 8 #26
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: build | |
on: | |
push: | |
branches: [ dev ] | |
pull_request: | |
branches: [ dev ] | |
jobs: | |
build-main: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
cache: 'maven' | |
- name: Setup Testcontainers Cloud Client | |
uses: atomicjar/testcontainers-cloud-setup-action@v1 | |
with: | |
token: ${{ secrets.TC_CLOUD_TOKEN }} | |
- name: Build and test 2Bass | |
run: mvn package | |
- name: Get pom version | |
id: pom-version | |
run: echo ::set-output name=version::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) | |
- name: Build docker image | |
if: success() && github.ref == 'refs/heads/dev' | |
run: ./_build-docker.sh | |
- name: Log in to Docker Hub | |
if: success() && github.ref == 'refs/heads/dev' | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Push | |
if: success() && github.ref == 'refs/heads/dev' | |
run: | | |
docker push curs/2bass:latest | |
docker image tag curs/2bass curs/2bass:${{ steps.pom-version.outputs.version }} | |
docker push curs/2bass:${{ steps.pom-version.outputs.version }} |