Skip to content

Commit

Permalink
chore: update prod workflow and docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
jycssu-com committed Jun 12, 2024
1 parent 73823e1 commit c10c0dd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ jobs:
runs-on: ubuntu-latest
needs: validate
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Login to registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_PASSWD }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: registry.realt.community/realtdashboard_prod:latest
tags: ${{ secrets.DOCKER_REGISTRY }}/dashboard:production

- name: Configure SSH
run: |
Expand All @@ -69,8 +69,9 @@ jobs:

- name: Update production environment
run: |
ssh staging 'cd /home/realt/docker/dashboard-v2/prod
ssh staging 'export DOCKER_REGISTRY=${{ secrets.DOCKER_REGISTRY }}
cd /var/docker/dashboard-v2/prod
git pull origin master
docker compose --file docker-compose-prod.yml pull
docker login -u ${{ secrets.DOCKER_LOGIN }} -p ${{ secrets.DOCKER_PASSWD }} ${{ secrets.DOCKER_REGISTRY }}
docker compose --file docker-compose-prod.yml up -d'
docker login -u ${{ secrets.DOCKER_LOGIN }} -p ${{ secrets.DOCKER_PASSWD }} ${DOCKER_REGISTRY}
THEGRAPH_API_KEY=${{ secrets.THEGRAPH_API_KEY }} COMMUNITY_API_KEY=${{ secrets.COMMUNITY_API_KEY }} docker compose --project-name production-dashboard --file docker-compose-prod.yml up -d'
18 changes: 9 additions & 9 deletions docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ version: '3'

services:
app:
image: registry.realt.community/realtdashboard_prod:latest
container_name: realtdashboard_prod
env_file:
- .env
ports:
- '3013:3000'
image: ${DOCKER_REGISTRY}/dashboard:production
container_name: production-dashboard
environment:
- THEGRAPH_API_KEY=$THEGRAPH_API_KEY
- COMMUNITY_API_KEY=$COMMUNITY_API_KEY
networks:
- traefik-realt
labels:
- "traefik.enable=true"
- "traefik.http.routers.dashboard-prod.rule=Host(`dashboard.realt.community`)"
- "traefik.http.routers.dashboard-prod.entrypoints=websecure"
- 'traefik.enable=true'
- 'traefik.http.routers.dashboard-production.rule=Host(`dashboard.realt.community`)'
- 'traefik.http.routers.dashboard-production.entrypoints=websecure'
- 'traefik.http.services.dashboard-production.loadbalancer.server.port=3000'
restart: always

networks:
Expand Down

0 comments on commit c10c0dd

Please sign in to comment.