Skip to content

Commit

Permalink
Refactor deployment workflow to use Docker commands for container man…
Browse files Browse the repository at this point in the history
…agement
  • Loading branch information
Satish Surath committed Feb 4, 2025
1 parent ae56dc4 commit 002d7dd
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/main_summarize-me.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
jobs:
build-and-deploy:
runs-on: self-hosted
# If you named your runner group something else, or labeled it, adjust accordingly
steps:
- name: Check out code
uses: actions/checkout@v3
Expand All @@ -20,14 +19,22 @@ jobs:
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
password: ${{ secrets.CR_PAT }}

- name: Build and push Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}:latest .
docker push ghcr.io/${{ github.repository }}:latest
- name: Deploy container using script
- name: Deploy container
run: |
chmod +x ../update-summarizeme.io.sh
../update-summarizeme.io.sh
# Pull the newest image
docker pull ghcr.io/${{ github.repository }}:latest
# Stop old container (if running)
docker stop summarizeme.io || true
docker rm summarizeme.io || true
# Run new container
docker run -d --name summarizeme.io \
--env-file=.env \
-p 8000:8000 \
ghcr.io/${{ github.repository }}:latest

0 comments on commit 002d7dd

Please sign in to comment.