-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (66 loc) · 2.66 KB
/
CI.yaml
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
72
73
74
75
76
77
78
79
80
81
82
name: Feature Branch CI
on:
push:
branches:
- feature/ci/#9
pull_request:
branches:
- feature/ci/#9
jobs:
build-and-package:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
#
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- name: Create and configure application.yml
run: |
echo "${{ secrets.APPLICATION_YML }}" > baebae-BE/src/main/resources/application.yml
echo "${{ secrets.APPLICATION_DEPLOY_YML }}" > baebae-BE/src/main/resources/application-deploy.yml
- name: Build with Gradle
run: |
cd baebae-BE
chmod +x ./gradlew
./gradlew build
- name: Create deployment package
run: |
zip -r deployment-package.zip baebae-BE/build/libs/baebae-BE-0.0.1-SNAPSHOT.jar
- name: Configure AWS CLI for Naver Cloud
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.NAVER_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.NAVER_SECRET_KEY }}
aws-region: ap-northeast-2
- name: Upload files to Naver Cloud Object Storage
run: |
aws --endpoint-url=https://kr.object.ncloudstorage.com s3 cp deployment-package.zip s3://baebae-bucket/deployment-package.zip
- name: Deploy to Naver Cloud Object Storage
env:
NAVER_ACCESS_KEY: ${{ secrets.NAVER_ACCESS_KEY }}
NAVER_SECRET_KEY: ${{ secrets.NAVER_SECRET_KEY }}
run: |
python upload_to_ncloud.py
- name: Deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.NAVER_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.NAVER_SECRET_KEY }}
run: |
aws --endpoint-url=https://kr.object.ncloudstorage.com
s3 cp deployment-package.zip
s3://baebae-bucket
- name: Install Naver Cloud CLI
run: |
wget https://files.pythonhosted.org/packages/3d/90/3eadc98b356ae462d2deb16715eafb8b3fa4b0707c56b6413632c1d687e2/awscli-1.15.85.tar.gz
tar -xzvf awscli-1.15.85.tar.gz
cd awscli-1.15.85
sudo python setup.py install
- name: Configure NAVER CLI credentials
run: aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} && aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Upload to Naver Cloud Object Storage
run: |
./ncloud/bin/ncloud object-storage upload --bucket-name baebae-bucket --source ./deployment-package.zip --object-name deployment-package.zip