-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (52 loc) · 2 KB
/
dev_deploy.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
name: Dev CI/CD
on:
push:
branches:
- ci
pull_request:
types: [closed]
workflow_dispatch: # Allow manual execution
jobs:
build:
runs-on: ubuntu-latest # (3). OS environment
if: |
(github.event_name == 'pull_request' && github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop') ||
(github.event_name == 'push' && github.event.ref == 'refs/heads/ci')
steps:
- name: Checkout
uses: actions/checkout@v2 # (4). Code checkout
- name: Set up JDK 17
uses: actions/setup-java@v3 # (5). Java setup
with:
java-version: '17'
distribution: 'adopt'
- name: Grant execute permission for gradlew and build with Gradle
run: |
chmod +x ./gradlew
./gradlew clean build -x test
shell: bash # (7). Build script
- name: Login to Docker Hub
run: |
docker login -u euegenechoi -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t euegenechoi/careerfestival .
docker push euegenechoi/careerfestival
- name: Get current time
uses: 1466587594/get-current-time@v2
id: current-time
with:
format: YYYY-MM-DDTHH-mm-ss
utcOffset: "+09:00" # (8). Time in your time zone
- name: Show current time
run: echo "CurrentTime=$"
shell: bash # (9). Show build time
- name: Deploy to Elastic Beanstalk with Beanstalk Deploy action
uses: einaregilsson/beanstalk-deploy@v20
with:
aws_access_key: ${{ secrets.AWS_ACTION_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_ACTION_SECRET_ACCESS_KEY }}
application_name: careerfestival-dev
environment_name: Careerfestival-dev-env
version_label: github-action-${{ steps.current-time.outputs.formattedTime }}
region: ap-northeast-2
deployment_package: Dockerrun.aws.json # Change to this after creating the file
wait_for_deployment: false