-
Notifications
You must be signed in to change notification settings - Fork 10
70 lines (59 loc) · 2.41 KB
/
maven.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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Environment
run: |
echo GITHUB_WORKSPACE $GITHUB_WORKSPACE
echo GITHUB_REF $GITHUB_REF
echo GITHUB_SHA $GITHUB_SHA
echo GITHUB_EVENT_NAME $GITHUB_EVENT_NAME
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Install metacity and xvfb
uses: awalsh128/[email protected]
with:
packages: xvfb metacity
version: 1.0
- name: Build with Maven
run: |
/usr/bin/Xvfb :99 -ac -screen 0 1440x900x16&
ps auxwww | grep Xvfb
export DISPLAY=:99
echo DISPLAY $DISPLAY
mvn clean verify -e -Dgpg.skip=true -Dmaven.wagon.provider.http=httpclient -Dmaven.artifact.threads=12 -Dhttp.tcp.nodelay=false
- name: Prepare deploy local directory
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
id: prepare_deploy
run: |
chmod a+x prepare-deploy-local-dir.sh
export TAG_OR_BRANCH="$(echo $GITHUB_REF | cut -d"/" -f3)/nightly"
if [[ "$(echo $GITHUB_REF | cut -d"/" -f2)" != "heads" ]]; then export TAG_OR_BRANCH="$(echo $GITHUB_REF | cut -d"/" -f3)"; fi
./prepare-deploy-local-dir.sh $GITHUB_WORKSPACE/$TAG_OR_BRANCH
echo "TAG_OR_BRANCH=${TAG_OR_BRANCH}" >> $GITHUB_OUTPUT
- name: Deploy to S3
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "eu-west-1"
SOURCE_DIR: ${{ steps.prepare_deploy.outputs.TAG_OR_BRANCH }}
DEST_DIR: capella-extensions/${{ steps.prepare_deploy.outputs.TAG_OR_BRANCH }}