Skip to content

build: admin CI/CD 파이프라인 구축 #3

build: admin CI/CD 파이프라인 구축

build: admin CI/CD 파이프라인 구축 #3

# This file was auto-generated by the Firebase CLI

Check failure on line 1 in .github/workflows/fb-hosting-admin-merge.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/fb-hosting-admin-merge.yml

Invalid workflow file

`build_and_deploy` is not a valid event name
# https://github.com/firebase/firebase-tools
name: Deploy Admin to Firebase Hosting on merge
'on':
push:
branches:
- main
s:
build_and_deploy:
runs-on: ubuntu-latest
environment: production
defaults:
run:
working-directory: packages/admin
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Make Last Hash
id: last
run: |
LAST_HASH=$(git rev-parse HEAD~:packages/admin)
echo "::set-output name=hash::$LAST_HASH"
- name: Make Current Hash
id: current
run: |
CURRENT_HASH=$(git rev-parse HEAD:packages/admin)
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.diff-check.outputs.diff == 'true'}}
run: |
jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' <<< "$SECRETS_CONTEXT" > .env
env:
SECRETS_CONTEXT: ${{ toJson(secrets) }}
- name: Install Dependencies and Build
if: ${{steps.diff-check.outputs.diff == 'true'}}
run: |
npm install -g pnpm && pnpm install && pnpm build
- name: Deploy to Firebase Hosting
if: ${{steps.diff-check.outputs.diff == 'true'}}
uses: FirebaseExtended/action-hosting-deploy@v0
with:
target: admin
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_WATERMELON_CLAP }}'
projectId: watermelon-clap
channelId: live