-
Notifications
You must be signed in to change notification settings - Fork 54
62 lines (62 loc) · 1.88 KB
/
docker.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Docker Build
'on':
workflow_dispatch: {}
push: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: '0'
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- 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_SAMPLES_USERNAME }}
password: ${{ secrets.DOCKERHUB_SAMPLES_PASSWORD }}
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.14
with:
versionSpec: 5.x
- id: determine_version
name: Determine Version
uses: gittools/actions/gitversion/execute@v0.9.14
with:
additionalArguments: /overrideconfig mode=Mainline
- name: Install Octopus Deploy CLI
uses: OctopusDeploy/install-octopus-cli-action@v1
with:
version: latest
- name: Set up JDK 1.17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: adopt
- name: Test
run: ./mvnw --batch-mode test
shell: bash
- if: always()
name: Report
uses: dorny/test-reporter@v1
with:
name: Maven Tests
path: target/surefire-reports/*.xml
reporter: java-junit
fail-on-error: 'false'
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: octopussamples/randomquotesjava:${{ steps.determine_version.outputs.semVer }}
- name: Create Octopus Release
uses: OctopusDeploy/create-release-action@v1.1.1
with:
api_key: ${{ secrets.OCTOPUS_API_TOKEN }}
project: Random Quotes
server: ${{ secrets.OCTOPUS_SERVER_URL }}
deploy_to: Dev
packages: Deploy container to Kubernetes:randomquotes:${{ steps.determine_version.outputs.semVer }}