Skip to content

Commit

Permalink
feat: github action에 gradle cache 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
gogo1414 committed Aug 17, 2024
1 parent 6c93a13 commit 38ce147
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 36 deletions.
Binary file modified .DS_Store
Binary file not shown.
66 changes: 30 additions & 36 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,53 @@ on:
branches: [ "main" ]

jobs:
build:
test:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Set up SSH
uses: webfactory/[email protected]
- name: Cache Gradle
uses: actions/cache@v3
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x ./gradlew

- name: Test with Gradle
run: ./gradlew test

build:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x ./gradlew

- name: Build with Gradle Wrapper
- name: Build with Gradle
run: ./gradlew clean build

- name: Configure AWS credentials
Expand All @@ -59,26 +76,3 @@ jobs:
--description "Deploying from GitHub Actions" \
--file-exists-behavior OVERWRITE \
--s3-location bucket=matal-s3,key=myapp.zip,bundleType=zip
dependency-submission:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

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

0 comments on commit 38ce147

Please sign in to comment.