Skip to content

Merge pull request #32 from gcatanese/renovate/org.apache.maven.plugi… #32

Merge pull request #32 from gcatanese/renovate/org.apache.maven.plugi…

Merge pull request #32 from gcatanese/renovate/org.apache.maven.plugi… #32

Workflow file for this run

name: Build and push to Docker
on:
push:
branches: [ "main" ]
paths-ignore:
- '**/README.md'
- .gitignore
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Build jar
run: mvn -B package --file pom.xml
- name: Build base image
run: docker build -f BaseDockerfile -t gcatanese/openapi-native-mock-server .
- name: Build mock server
run: docker build --build-arg openapifile=openapi/sample.yaml -t openapi-native-mock-server .
- name: Run mock server
run: docker run --rm -d -p 8080:8080 --name openapi-native-mock-server openapi-native-mock-server
- name: Ping mock server URLs
uses: jtalk/url-health-check-action@v4
with:
url: http://localhost:8080/index|http://localhost:8080/openapi
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
file: BaseDockerfile
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: gcatanese/openapi-native-mock-server:latest