-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (51 loc) · 2.03 KB
/
gradle-publish.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
name: CI/CD pipeline
on:
push:
branches: [ "main" ]
permissions:
contents: read
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create necessary directories
run: |
mkdir -p core/core-infra-rdb/src/main/resources
mkdir -p core/core-security/src/main/resources
mkdir -p core/core-infra-s3/src/main/resources
mkdir -p core/core-infra-feign/src/main/resources
mkdir -p key
- name: Create application-properties.yml
run: |
echo "${{ secrets.APPLICATION_INFRA_RDB }}" > core/core-infra-rdb/src/main/resources/application-infra-rdb.yml
echo "${{ secrets.APPLICATION_SECURITY }}" > core/core-security/src/main/resources/application-security.yml
echo "${{ secrets.APPLICATION_AWS_CLOUD }}" > core/core-infra-s3/src/main/resources/application-s3.yml
echo "${{ secrets.APPLICATION_FEIGN }}" > core/core-infra-feign/src/main/resources/application-feign.yml
echo "${{ secrets.APPLE_KEY }}" > key/${{secrets.APPLE_KEY_NAME}}.p8
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: Build the Docker image
run: docker build -t ${{secrets.DOCKERHUB_REPOSITORY}}/daldal-api:latest -f ./api/DockerFile .
- name: Docker Push
run: docker push ${{secrets.DOCKERHUB_REPOSITORY}}/daldal-api:latest
cd:
needs: ci
runs-on: ubuntu-latest
steps:
- name: Trigger Portainer Webhook
run: |
PORTAINER_WEBHOOK_URL=${{secrets.PORTAINER_WEBHOOK_DNS}}
curl -X POST -d "{}" -H "Content-Type: application/json" --insecure $PORTAINER_WEBHOOK_URL