-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (71 loc) · 3.24 KB
/
docker-image.yml
File metadata and controls
85 lines (71 loc) · 3.24 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Docker Image CI/CD
on:
push:
branches: [ "main" ]
permissions:
contents: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout from Github 🥚
uses: actions/checkout@v3
- name: Set up JDK 17 🐣
uses: actions/setup-java@v4.0.0
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Maven 3.9.6 🐤
uses: stCarolas/setup-maven@v.4.5
with:
maven-version: 3.9.6 # default is 3.8.2
- name: Debug 🐛
run: mvn -version
- name: Build with Maven
run: mvn package --file pom.xml
- name: GitHub Action for DigitalOcean - doctl 🌊
uses: digitalocean/action-doctl@v2.5.0
with:
token: ${{ secrets.DIGITALOCEAN_TOKEN }}
- name: Authenticate to DigitalOcean 🔐
run: doctl registry login --expiry-seconds 600
- name: Build and push image 🏗
run: |-
docker build . --file Dockerfile --tag ${{ vars.DOCKER_IMAGE }} &&
docker tag ${{ vars.DOCKER_IMAGE }} registry.digitalocean.com/${{ vars.DIGITALOCEAN_CONTAINER_REGISTRY }}/${{ vars.DOCKER_IMAGE }} &&
docker push registry.digitalocean.com/${{ vars.DIGITALOCEAN_CONTAINER_REGISTRY }}/${{ vars.DOCKER_IMAGE }}
scan-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout from Github 🥚
uses: actions/checkout@v3
- name: Set up JDK 17 🐣
uses: actions/setup-java@v4.0.0
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Maven 3.9.6 🐤
uses: stCarolas/setup-maven@v.4.5
with:
maven-version: 3.9.6 # default is 3.8.2
- name: Debug 🐛
run: mvn -version && chmod +x mvnw
- name: Maven Dependency Tree Dependency Submission
# You may pin to the exact commit or the version.
# uses: advanced-security/maven-dependency-submission-action@fcd7eab6b6d22946badc98d1e62665cdee93e0ae
uses: advanced-security/maven-dependency-submission-action@v3.0.3
#with:
# The directory that contains the maven project
#directory: ${{ github.workspace }} # optional, default is ${{ github.workspace }}
# Optional path to a Maven settings.xml file for the dependencies to be resolved
#settings-file: # optional
# Flag for optionally ignoring any maven wrapper files (mvnw) and instead rely on the PATH provided mvn
#ignore-maven-wrapper: # optional
# Additional maven arguments to add to the command line invocation of maven when it generates the dependency snapshot
#maven-args: # optional, default is
# Optionally include the file name in the dependency snapshot report to GitHub. This is required to be true if you want the results in the dependency tree to have a working link.
#snapshot-include-file-name: # optional, default is true
# An optional override to specify the path to the file in the repository that the snapshot should be associated with.
#snapshot-dependency-file-name: # optional
# The GitHub token to use to submit the depedency snapshot to the repository
#token: ${{ github.token }} # optional, default is ${{ github.token }}