Skip to content

Merge pull request #78 from le2sky/develop #7

Merge pull request #78 from le2sky/develop

Merge pull request #78 from le2sky/develop #7

name: Mealkitary main CD
on:
push:
branches:
- 'main'
jobs:
cd:
runs-on: ubuntu-latest
steps:
- id: check_pr_labels
name: PR ๋ผ๋ฒจ ํ™•์ธ
shell: bash
run: |
pull_request_labels=$(curl \
--fail \
-H "Accept: application/vnd.github.groot-preview+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"${{ github.api_url }}/repos/${{ github.repository }}/commits/${{ github.sha }}/pulls" \
| jq -r ".[0].labels[].name")
if echo "$pull_request_labels" | grep -q '^no-deployment$' ; then
echo "::set-output name=DEPLOYMENT::false"
fi
- uses: actions/checkout@v3
- name: Firebase ์‹œํฌ๋ฆฟ ์ƒ์„ฑ
run: |
echo ${{ secrets.ENCODED_FIREBASE_JSON }} | base64 -d > ./mealkitary-infrastructure/adapter-firebase-notification/src/main/resources/firebase.json
- name: JDK 11 ๊ตฌ์„ฑ
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'gradle'
- name: Gradlew wrapper ์‹คํ–‰ ๊ถŒํ•œ ๋ถ€์—ฌ
run: chmod +x gradlew
- name: Gradle ์บ์‹ฑ
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle ๋นŒ๋“œ
if: ${{ steps.check_pr_labels.outputs.DEPLOYMENT != 'false' }}
run: ./gradlew clean build
- name: Docker ๋กœ๊ทธ์ธ
if: ${{ steps.check_pr_labels.outputs.DEPLOYMENT != 'false' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: ๋„์ปค ์ด๋ฏธ์ง€ ๋นŒ๋“œ, ๋ ˆ์ง€์ŠคํŠธ๋ฆฌ ์ „์†ก
if: ${{ steps.check_pr_labels.outputs.DEPLOYMENT != 'false' }}
run: ./gradlew jib