Revert "[FE]Refactor/#147 토픽 카드 이미지 적용 및 blur처리" #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Frontend production CD | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [ develop ] | |
types: [closed] | |
paths: frontend/** | |
permissions: | |
contents: read | |
jobs: | |
build-and-upload: | |
if: github.event.pull_request.merged | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
cache-dependency-path: "frontend" | |
- name: Install npm | |
run: npm install | |
working-directory: frontend | |
- name: grant execute access | |
run: chmod +x npm | |
working-directory: frontend | |
- name: Build project | |
run: npm run build | |
working-directory: frontend | |
- name: upload to artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: FrontendApplication | |
path: frontend/dist | |
deploy: | |
runs-on: [ self-hosted, prod] | |
needs: build-and-upload | |
if: github.event.pull_request.merged | |
steps: | |
- name: delete old js file | |
run: rm -rf /home/ubuntu/frontend/dist | |
- name: download js file from artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: FrontendApplication | |
path: /home/ubuntu/frontend/ | |
- name: deploy | |
run: /home/ubuntu/frontend/deploy.sh | |
- name: send slack message | |
uses: 8398a7/action-slack@v3 | |
with: | |
mention: 'here' | |
if_mention: always | |
status: ${{ job.status }} | |
fields: workflow,job,commit,message,ref,author,took | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
if: always() |