refactor: access token의 불필요한 중괄호 제거 #16
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-cd | |
on: | |
push | |
#pull_request: | |
#types: | |
# - closed | |
#branches: ['develop'] | |
# paths: | |
# - 'frontend/**' | |
defaults: | |
run: | |
working-directory: frontend | |
permissions: | |
contents: read | |
jobs: | |
build-and-upload: | |
# if: github.event.pull_request.merged == true | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Set up Repository | |
uses: actions/checkout@v3 | |
- name: Setup node with cache | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- name: Setup environment variables | |
run: | | |
echo "REACT_APP_ACCESS_TOKEN=${{ secrets.REACT_APP_ACCESS_TOKEN }}" >> .env | |
- name: Install dependencies | |
run: npm ci | |
- name: Build App | |
run: npm run build | |
- name: Upload frontend build file to artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: FrontendApplication | |
path: frontend/dist | |
deploy: | |
needs: build-and-upload | |
runs-on: self-hosted | |
env: | |
DEV_DEPLOY_SCRIPT: ${{ secrets.DEV_FRONT_DEPLOY_SCRIPT }} | |
steps: | |
- name: Remove previous version app | |
working-directory: ./frontend/dev/ | |
run: rm -rf dist | |
- name: Download build file from artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: FrontendApplication | |
path: frontend/dev/dist | |
- name: Deploy to WAS | |
working-directory: ./frontend/dev/ | |
run: | | |
echo "$DEV_DEPLOY_SCRIPT" > dev-deploy.sh | |
chmod 700 dev-deploy.sh | |
./dev-deploy.sh |