Skip to content

Commit

Permalink
deploy.yml - docker-build-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenaH84 committed Feb 6, 2024
1 parent 89191af commit 9af95d3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ on:
env:
SSH_USER: lhendrix
SSH_HOST: 51.68.188.78
WORKDIR:
REGISTRY: ghcr.io
IMAGE_NAME: battmoteam/battmogui:latest
WORKDIR: battmogui

jobs:

Expand All @@ -25,7 +27,11 @@ jobs:
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.ACTIONS_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ env.SSH_HOST }} > ~/.ssh/known_hosts
- name: connect and pull
run: ssh ${{ env.SSH_USER }}@${{ env.SSH_HOST }} "cd ${{ env.WORKDIR }} && docker-compose pull && docker-compose docker-compose.yml up -d && exit"
- name: connect
run: ssh ${{ env.SSH_USER }}@${{ env.SSH_HOST }} "cd ${{ env.WORKDIR }}
- name: login registry
run: echo ${{ secrets.PAT }} | docker login ghcr.io -u lorenah84 --password-stdin
- name: pull and run containers
run: docker compose pull && docker compose docker-compose.yml up -d && exit"
- name: cleanup
run: rm -rf ~/.ssh
4 changes: 2 additions & 2 deletions .github/workflows/docker-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Build and Publish
run: |
docker compose -f docker-compose.yml build
docker compose -f docker-compose.yml push
docker compose -f docker-compose.yml build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} && docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ services:
container_name: streamlit
restart: always
ports:
- "8501:8501"
- "80:80"
# volumes:
# - type: bind
# source: $HOST/location
# target: /container/location
# depends_on:
# - flask
command: streamlit run Introduction.py --global.disableWidgetStateDuplicationWarning true --server.port=8501
command: streamlit run Introduction.py --global.disableWidgetStateDuplicationWarning true --server.port=80

0 comments on commit 9af95d3

Please sign in to comment.