|
@@ -15,6 +15,18 @@ jobs:
|
|
|
- name: Check out code
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
+ - name: Set up JDK 1.8
|
|
|
+ uses: actions/setup-java@v2
|
|
|
+ with:
|
|
|
+ version: 1.8
|
|
|
+ jdk: true
|
|
|
+
|
|
|
+ - name: Dump Github context
|
|
|
+ env:
|
|
|
+ GITHUB_CONTEXT: '${{ toJSON(github) }}'
|
|
|
+ run: |
|
|
|
+ echo " hello ${{ github.event.commits[0].id }}"
|
|
|
+
|
|
|
- name: Cache local Maven repository
|
|
|
uses: actions/cache@v2
|
|
|
with:
|
|
@@ -32,3 +44,39 @@ jobs:
|
|
|
restore-keys: |
|
|
|
${{ runner.os }}-gradle-
|
|
|
|
|
|
+ - name: Build with Gradle
|
|
|
+ run: |
|
|
|
+ chmod +x gradlew
|
|
|
+ ./gradlew build
|
|
|
+
|
|
|
+ - name: Extract files from jar
|
|
|
+ run: |
|
|
|
+ mkdir -p build/libs
|
|
|
+
|
|
|
+ - name: build docker image and push
|
|
|
+ env:
|
|
|
+ DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
|
+ DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
+ DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
|
|
|
+ run: |
|
|
|
+ docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} ${{ secrets.DOCKER_REGISTRY }}
|
|
|
+
|
|
|
+ - name: set buildx
|
|
|
+ uses: crazy-max/ghaction-docker-buildx@v1
|
|
|
+ with:
|
|
|
+ buildx-version: latest
|
|
|
+
|
|
|
+ - name: push docker image
|
|
|
+ run: |
|
|
|
+ cd build && \
|
|
|
+ fullCommit="${{ github.event.commits[0].id }}" && \
|
|
|
+ docker buildx build \
|
|
|
+ --platform linux/amd64,linux/arm64,linux/arm/v7 \
|
|
|
+ --tag ${{ secrets.DOCKER_REGISTRY }}/{{ github.repository.owner.login }}/{{ github.repository.name }}:${{ fullCommit: 0:7 }} \
|
|
|
+ --progress=plain \
|
|
|
+ --file Dockerfile . \
|
|
|
+ --output "type=image,push=true"
|
|
|
+ --push
|
|
|
+
|
|
|
+ - name: deploy to docker
|
|
|
+
|