-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (52 loc) · 1.84 KB
/
car-demo-pipeline.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
name: car-demo-common-service
on:
push:
branches: [ main ]
env:
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
jobs:
setup-build-publish-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 19
uses: actions/setup-java@v3
with:
java-version: '19'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }}
- uses: 'google-github-actions/auth@v1'
with:
credentials_json: ${{ secrets.GKE_KEY }}
- uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ env.GKE_PROJECT }}
# Configure Docker to use the gcloud command-line tool as a credential
# helper for authentication
- name: configure docker
run: |-
gcloud --quiet auth configure-docker
- name: Debug Information
run: |
echo "GitHub Token: $CUSTOM_TOKEN"
env
- name: Set up Maven settings
run: |
mkdir -p $HOME/.m2
echo "<settings><servers><server><id>github</id><username>sgknoldus</username><password>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</password></server></servers></settings>" > $HOME/.m2/settings.xml
#env:
#GITHUB_USERNAME: ${{ github.actor }}
- name: Debug Maven settings
run: |
cat $HOME/.m2/settings.xml
- name: Build, Publish, and Deploy
run: |
. apps-deployment-script.sh "us-east1"
env:
CUSTOM_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN_PAT }}
#GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}