diff --git a/.github/workflows/fb-hosting-service-merge.yml b/.github/workflows/fb-hosting-service-merge.yml index 998e354a..3cefcbdc 100644 --- a/.github/workflows/fb-hosting-service-merge.yml +++ b/.github/workflows/fb-hosting-service-merge.yml @@ -15,22 +15,39 @@ jobs: working-directory: packages/service steps: - uses: actions/checkout@v3 - - uses: technote-space/get-diff-action@v6 - with: - RELATIVE: '/' - id: git-diff + - name: Make Last Hash + id: last + run: | + LAST_HASH=$(git rev-parse HEAD^:packages/service) + echo "::set-output name=hash::$LAST_HASH" + + - name: Make Current Hash + id: current + run: | + CURRENT_HASH=$(git rev-parse HEAD:packages/service) + echo "::set-output name=hash::$CURRENT_HASH" + + - name: Set Diff + id: diff-check + run: | + if [ "${{ steps.last.outputs.hash }}" != "${{ steps.current.outputs.hash }}" ]; then + echo "::set-output name=diff::true" + else + echo "::set-output name=diff::false" + fi + - name: Create .env file - if: steps.git-diff.outputs.diff + if: steps.diff-check.outputs.diff run: | jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' <<< "$SECRETS_CONTEXT" > .env env: SECRETS_CONTEXT: ${{ toJson(secrets) }} - name: Install Dependencies and Build - if: steps.git-diff.outputs.diff + if: steps.diff-check.outputs.diff run: | npm install -g pnpm && pnpm install && pnpm build - name: Deploy to Firebase Hosting - if: steps.git-diff.outputs.diff + if: steps.diff-check.outputs.diff uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/fb-hosting-service-pull-request.yml b/.github/workflows/fb-hosting-service-pull-request.yml index 426934f9..55e06b69 100644 --- a/.github/workflows/fb-hosting-service-pull-request.yml +++ b/.github/workflows/fb-hosting-service-pull-request.yml @@ -1,11 +1,10 @@ -# This file was auto-generated by the Firebase CLI -# https://github.com/firebase/firebase-tools - name: Deploy Service to Firebase Hosting on PR -'on': pull_request +on: pull_request jobs: + + build_and_preview: - if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}' + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} runs-on: ubuntu-latest environment: preview defaults: @@ -13,24 +12,46 @@ jobs: working-directory: packages/service steps: - uses: actions/checkout@v3 - - uses: technote-space/get-diff-action@v6 with: - RELATIVE: 'packages/service' - id: git-diff + fetch-depth: 0 + + - run: git branch -a + - name: Make Last Hash + id: last + run: | + LAST_HASH=$(git rev-parse remotes/origin/main:packages/service) + echo "::set-output name=hash::$LAST_HASH" + + - name: Make Current Hash + id: current + run: | + CURRENT_HASH=$(git rev-parse HEAD:packages/service) + echo "::set-output name=hash::$CURRENT_HASH" + + - name: Set Diff + id: diff-check + run: | + if [ "${{ steps.last.outputs.hash }}" != "${{ steps.current.outputs.hash }}" ]; then + echo "::set-output name=diff::true" + else + echo "::set-output name=diff::false" + fi - name: Create .env file - if: steps.git-diff.outputs.diff + if: ${{ steps.diff-check.outputs.diff }} run: | jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' <<< "$SECRETS_CONTEXT" > .env env: SECRETS_CONTEXT: ${{ toJson(secrets) }} + - name: Install Dependencies and Build - if: steps.git-diff.outputs.diff + if: ${{ steps.diff-check.outputs.diff }} run: | npm install -g pnpm && pnpm install && pnpm build + - name: Deploy to Firebase Hosting - if: steps.git-diff.outputs.diff + if: ${{ steps.diff-check.outputs.diff }} uses: FirebaseExtended/action-hosting-deploy@v0 with: - repoToken: '${{ secrets.GITHUB_TOKEN }}' - firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_WATERMELON_CLAP }}' - projectId: watermelon-clap \ No newline at end of file + repoToken: ${{ secrets.GITHUB_TOKEN }} + firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_WATERMELON_CLAP }} + projectId: watermelon-clap diff --git a/packages/service/src/Main/pages/MainPage.tsx b/packages/service/src/Main/pages/MainPage.tsx index 54c4b320..f81a2629 100644 --- a/packages/service/src/Main/pages/MainPage.tsx +++ b/packages/service/src/Main/pages/MainPage.tsx @@ -41,7 +41,7 @@ export const MainPage = () => { right: 20px; `} > - 개발 + 개발ㄴ );