| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- name: Release
- on:
- push:
- branches: [ main ]
- jobs:
- build-and-test:
- name: Build and Test
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - name: Set up JDK
- uses: actions/setup-java@v3
- with:
- java-version: '21'
- distribution: 'temurin'
- - name: Build with Gradle
- run: chmod +x ./gradlew && ./gradlew clean build test
- dockerize:
- name: Dockerize Application
- needs: build-and-test
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
- - name: Cache Docker layers
- uses: actions/cache@v2
- with:
- path: /tmp/.buildx-cache
- key: ${{ runner.os }}-buildx-${{ github.sha }}
- restore-keys: ${{ runner.os }}-buildx-
- - name: Set up JDK
- uses: actions/setup-java@v3
- with:
- java-version: '21'
- distribution: 'temurin'
- - name: Build the Docker image
- run: ./gradlew build && docker build -t dbohry/auth-service .
- - name: Login to Docker Hub
- uses: docker/login-action@v2
- with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
- - name: Push image
- run: docker push dbohry/auth-service
- dockerize-arm:
- name: Dockerize ARM Application
- needs: build-and-test
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - name: Set up JDK
- uses: actions/setup-java@v3
- with:
- java-version: '21'
- distribution: 'temurin'
- - name: Build
- run: ./gradlew build
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v2
- - name: Login to Docker Hub
- uses: docker/login-action@v2
- with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
- - name: Build and Push ARM Image
- run: |
- docker buildx create --use
- docker buildx build --platform linux/arm64 -t dbohry/auth-service:arm-latest --push .
|