Skip to content

[BE] CI/CD 테스트 #9

[BE] CI/CD 테스트

[BE] CI/CD 테스트 #9

name: backEnd API server CI/CD
on:
pull_request:
branches: [BE/release]
jobs:
api-server-ci:
runs-on: ubuntu-20.04
steps:
- name: ✅ 코드 체크아웃
uses: actions/checkout@v3
- name : 👻 노드 설정
uses : actions/setup-node@v3
with:
node-version: '20'
- name : ⚒️ pm2 설치
run: npm i pm2 -g
- name : 🔐 env 설정
run: |
echo "WEB_HOOK_URL=${{secrets.WEB_HOOK_URL}}" >> .env
echo "PORT=${{secrets.PORT}}" >> .env
echo "DB_HOST=${{secrets.DB_HOST}}" >> .env
echo "DB_PORT=${{secrets.DB_PORT}}" >> .env
echo "DB_USERNAME=${{secrets.DB_USERNAME}}" >> .env
echo "DB_PASSWORD=${{secrets.DB_PASSWORD}}" >> .env
echo "DB_DATABASE=${{secrets.DB_DATABASE}}" >> .env
echo "SYNCHRONIZED=${{secrets.SYNCHRONIZED}}" >> .env
- name: ⬇️ 의존성 설치
working-directory: ./backEnd/api
run: npm install
- name: ✅ 유닛 테스트
working-directory: ./backEnd/api
run: npm test
- name: 📦 프로젝트 빌드
working-directory: ./backEnd/api
run: npm run build
# - name: 🐳 도커 로그인
# uses: docker/login-action@v1
# with:
# username: ${{secrets.DOCKER_USERNAME}}
# password: ${{secrets.DOCKER_TOKEN}}
- name: ⬆️ Docker Image Build
working-directory: ./backEnd/api
run: |

Check failure on line 51 in .github/workflows/back-release-deploy.yml

View workflow run for this annotation

GitHub Actions / backEnd API server CI/CD

Invalid workflow file

The workflow is not valid. .github/workflows/back-release-deploy.yml (Line: 51, Col: 14): Unexpected symbol: 'PASSWORD'. Located at position 17 within expression: secrets.DOCKER_ PASSWORD
docker login -u ${{secrets.DOCKER_USERNAME}} -p ${{secrets.DOCKER_
PASSWORD}}
docker build -t ${{secrets.DOCKER_USERNAME}}/api .
docker push ${{secrets.DOCKER_USERNAME}}/api
- name: 🏃‍♂️ Deploy
uses: appleboy/[email protected]
with:
host: ${{secrets.API_HOST}}
username: ${{secrets.API_USERNAME}}
password: ${{secrets.API_PASSWORD}}
port: ${{secrets.API_PORT}}
script: sh deploy.sh