Skip to content

Container build

Container build #18

Workflow file for this run

name: Java CI
on:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run tests
run: ./gradlew clean check
package:
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Build
run: ./gradlew assemble -x test
# Todo - correct container name
- name: Docker build
run: docker build -t javabin/orbit:${{ github.sha }} -t javabin/orbit:latest .
# Todo - If Dockerhub - login here
#- name: Login to DockerHub Registry
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# Todo - push container
#- name: Push sha image
# run: docker push chrissearle/utegang:${{ github.sha }}
# Todo - push latest
#- name: Push latest image
# run: docker push chrissearle/utegang:latest
- name: Generate summary
run: |
echo "Tag: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY