This repository has been archived by the owner on Dec 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (59 loc) · 2.94 KB
/
ci-with-docker-develop.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
# 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: CI with Docker
on:
push:
branches: [ develop ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 11
- name: Build with Maven
run: mvn package --file pom.xml --batch-mode --quiet --no-transfer-progress
env:
LIVE_POLL_MYSQL_URL: ${{ secrets.API_LIVE_POLL_MYSQL_URL }}
LIVE_POLL_MYSQL_USER: ${{ secrets.API_LIVE_POLL_MYSQL_USER }}
LIVE_POLL_MYSQL_PASSWORD: ${{ secrets.API_LIVE_POLL_MYSQL_PASSWORD }}
LIVE_POLL_DEV_URL: ${{ secrets.API_LIVE_POLL_DEV_URL }}
LIVE_POLL_FRONTEND_URL: ${{ secrets.API_LIVE_POLL_FRONTEND_URL }}
LIVE_POLL_SERVER_URL: ${{ secrets.API_LIVE_POLL_SERVER_URL }}
LIVE_POLL_MAIL_HOST: ${{ secrets.API_LIVE_POLL_MAIL_HOST }}
LIVE_POLL_MAIL_PORT: ${{ secrets.API_LIVE_POLL_MAIL_PORT }}
LIVE_POLL_MAIL_USERNAME: ${{ secrets.API_LIVE_POLL_MAIL_USERNAME }}
LIVE_POLL_MAIL_PASSWORD: ${{ secrets.API_LIVE_POLL_MAIL_PASSWORD }}
LIVE_POLL_JWT_AUTH_COOKIE_NAME: ${{ secrets.API_LIVE_POLL_JWT_AUTH_COOKIE_NAME }}
LIVE_POLL_JWT_COOKIE_KEY_VALUE: ${{ secrets.API_LIVE_POLL_JWT_COOKIE_KEY_VALUE }}
LIVE_POLL_JWT_SECRET: ${{ secrets.API_LIVE_POLL_JWT_SECRET }}
LIVE_POLL_HTTPS_ENABLED: ${{ secrets.API_LIVE_POLL_HTTPS_ENABLED }}
LIVE_POLL_HTTPS_CERT_PASSWORD: ${{ secrets.API_LIVE_POLL_HTTPS_CERT_PASSWORD }}
CUCUMBER_PUBLISH_TOKEN: ${{ secrets.CUCUMBER_PUBLISH_TOKEN }}
- name: CodeCov report deploy
run: bash <(curl -s https://codecov.io/bash)
- name: Prepare environment
run: |
sudo apt-get install --yes --no-install-recommends libxml-xpath-perl
export ARTIFACT_ID=$(xpath -q -e "/project/artifactId/text()" pom.xml)
echo "ARTIFACT_ID=${ARTIFACT_ID}" >> $GITHUB_ENV
export VERSION=$(xpath -q -e "/project/version/text()" pom.xml)
export VERSION=${VERSION//-SNAPSHOT}-$(git rev-parse --short ${GITHUB_SHA})
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: GH Packages deploy
uses: actions/upload-artifact@v1
with:
name: target
path: target
- name: Docker build and push
run: |
echo ${CR_PAT} | docker login ghcr.io -u ${GITHUB_REPOSITORY_OWNER} --password-stdin
docker build -t ghcr.io/livepoll/${ARTIFACT_ID}-dev:${VERSION} -t ghcr.io/livepoll/${ARTIFACT_ID}-dev:latest .
docker push ghcr.io/livepoll/${ARTIFACT_ID}-dev:${VERSION}
docker push ghcr.io/livepoll/${ARTIFACT_ID}-dev:latest
env:
CR_PAT: ${{ secrets.CR_PAT }}