-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (58 loc) · 2.06 KB
/
aaDeploy.yml
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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Deploy AAesAmerican
on:
workflow_dispatch:
#push:
# branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
id: login-docker
uses: docker/login-action@v2
with:
username: asarco
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: maven
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: /home/runner/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2repo
- name: Restore Maven cache
uses: actions/cache@v2
with:
path: /home/runner/.m2/repository
key: ${{ runner.os }}-m2repo-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2repo
- name: Get current date
id: date
run: |
echo "NOW=$(date +'%Y%m%dT%H%M%S')" >> $GITHUB_ENV
echo $NOW
- name: Build Docker image with Dockerfile
run: |
mvn -B clean package -DskipTests -pl AAesAmerican,commons -Drevision=${{ env.NOW }}
cd AAesAmerican
docker build --build-arg REVISION=${{ env.NOW }} -t asarco/aaesamerican .
docker tag asarco/aaesamerican asarco/aaesamerican:${{ env.NOW }}
- name: Publish Docker image
id: publish
run : |
docker push asarco/aaesamerican:${{ env.NOW }}
echo "::set-output name=deployed::true"