Skip to content

logging fix and connection pooling #22

logging fix and connection pooling

logging fix and connection pooling #22

Workflow file for this run

name: Docker Build & Push and Deploy to dev for score-backend
on:
push:
branches: [master]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
outputs:
sha_short: ${{ steps.vars.outputs.sha_short }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get SHA
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Docker Build & Push
uses: docker/build-push-action@v6
with:
context: ./
file: ./Dockerfile
push: true
tags: cornellappdev/score-dev:${{ steps.vars.outputs.sha_short }}
cache-from: type=registry,ref=cornellappdev/score-dev:cache
cache-to: type=registry,ref=cornellappdev/score-dev:cache,mode=max
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Remote SSH and Deploy
uses: appleboy/[email protected]
env:
IMAGE_TAG: ${{ needs.build.outputs.sha_short }}
with:
host: ${{ secrets.DEV_SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.DEV_SERVER_KEY }}
envs: IMAGE_TAG
script: |
docker stack deploy -c docker-compose.yml thestack
docker service update --image cornellappdev/score-dev:${IMAGE_TAG} thestack_app
docker system prune -af