Skip to content

Commit

Permalink
dogVelopers#25 github action test
Browse files Browse the repository at this point in the history
  • Loading branch information
kpeel5839 committed Mar 15, 2022
1 parent 468c440 commit 474b7ea
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pullRequest.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Spring build gradle

on:
push:
branches:
- develop
# push:
# branches:
# - develop

pull_request:
branches:
Expand Down
41 changes: 40 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,43 @@ name: Spring build gradle
on:
push:
branches:
# - develop # 내가 평소에 PR 하기 전 작업하는 branch 에다가 적용
- develop # 내가 평소에 PR 하기 전 작업하는 branch 에다가 적용

env:
S3_BUCKET_NAME: cafein-deploy # bucket name 변수 생성
PATH: dogvelopers
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'

- name: Grant execute permission for gradlew
run: chmod +x gradlew
working-directory: ${{ PATH }}

- name: Build with Gradle
run: ./gradlew clean build
working-directory: ${{ PATH }}

- name: Make zip file
run: zip -r ./$GITHUB_SHA.zip .
shell: bash
working-directory: ${{ PATH }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Upload to S3
run: aws s3 cp --region ap-northeast-2 ./dogvelopers/$GITHUB_SHA.zip s3://$S3_BUCKET_NAME/$GITHUB_SHA.zip

0 comments on commit 474b7ea

Please sign in to comment.