Skip to content

Commit

Permalink
Fix docker file to remove containers by ancestor tags
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasKnudsen committed Apr 10, 2024
1 parent 74fc343 commit 610686e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/autoredeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ jobs:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Remove old Docker images
- name: Stop and remove containers by tag
run: |
docker rmi $(docker images -q backend:outreach) || true
docker rmi $(docker images -q frontend:outreach) || true
# Stop containers running from 'backend:outreach' image
docker ps -q --filter ancestor=backend:outreach | xargs -r docker stop
# Stop containers running from 'frontend:outreach' image
docker ps -q --filter ancestor=frontend:outreach | xargs -r docker stop
# Now, remove the images
docker rmi backend:outreach frontend:outreach || true
- name: Create .env files
run: |
# Create .env with all variables except HOST_URL Backend
Expand Down

0 comments on commit 610686e

Please sign in to comment.