fix: Add GitHub action #5
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: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'maven' | |
- name: Build with Maven | |
run: | | |
cd test-services | |
mvn clean install -DskipTests=true | |
- uses: actions/checkout@v3 | |
- name: Build the Docker image | |
run: | | |
cd test-services | |
docker build . --file Dockerfile --tag ghcr.io/vsds/testbed-service:1.0.0 | |
docker login ghcr.io -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
- uses: actions/checkout@v3 | |
- name: Build the Docker image | |
run: | | |
cd test-services | |
docker push ghcr.io/vsds/testbed-service:1.0.0 |