과제 2-7 boxinthechaos 과제제출 #32
Workflow file for this run
This file contains hidden or 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: Test and Build | |
| on: | |
| push: | |
| branches: master | |
| pull_request: | |
| branches: [ "*" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📂 Checkout Repository | |
| uses: actions/checkout@v3 | |
| - name: 🐋 Docker Build | |
| run: docker build -t task27:test . | |
| - name: ⏬ Install Docker Compose | |
| run: | | |
| sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
| sudo chmod +x /usr/local/bin/docker-compose | |
| docker-compose --version | |
| - name: 🐋 Docker Run (MySQL & Redis) | |
| run: docker-compose -f compose.yaml up -d | |
| - name: ⌛ Wait for Services | |
| run: sleep 30 | |
| - name: 🐋 Run Task.2-7 Server Container | |
| run: docker run --name task27-server --network=compose_default -d -p 8080:8080 task27:test | |
| - name: ⌛ Wait for Application | |
| run: sleep 45 | |
| - name: 📃 Log Trace | |
| run: docker logs task27-server | |
| - name: 🧪 Test Application | |
| run: | | |
| RESPONSE=$(curl -s "http://localhost:8080/health/check") | |
| if [ "$RESPONSE" != "OK" ]; then | |
| echo "💣 Health Check Failed" | |
| exit 1 | |
| fi |