Skip to content

Commit

Permalink
BUILD - refactored CI/CD keys, names
Browse files Browse the repository at this point in the history
  • Loading branch information
vladokuskov committed Apr 16, 2024
1 parent 434a016 commit 7abe7ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/auto.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Automated deployment 🤖
name: Automated Testing and Verification 🤖

on:
push:
Expand All @@ -15,4 +15,4 @@ jobs:

- name: Build Docker image 🐳
run: |
docker build -f docker/staging/Dockerfile . --tag ${{ secrets.DOCKER_REGISTRY }}/stage-deployment
docker build -f docker/staging/Dockerfile . --tag ${{ secrets.DOCKER_USERNAME }}/stage-deployment
10 changes: 5 additions & 5 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout code 🔎
- name: Checkout repository 🔎
uses: actions/checkout@v3

- name: Build Docker image 🐳
run: |
docker build -f docker/production/Dockerfile . --tag ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_PROD_IMAGE_NAME }}:latest
docker build -f docker/production/Dockerfile . --tag ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_PROD_IMAGE_NAME }}:latest
- name: Publish Docker image 📦
run: |
docker login -u ${{ secrets.DOCKER_REGISTRY }} -p ${{ secrets.DOCKER_HUB_TOKEN }}
docker push ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_PROD_IMAGE_NAME }}
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker push ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_PROD_IMAGE_NAME }}
deploy:
needs: build
Expand All @@ -34,6 +34,6 @@ jobs:
ssh-keyscan -H ${{ secrets.HOST }} > ~/.ssh/known_hosts
- name: Pull and run container 🏃️
run: ssh ${{ secrets.USERNAME }}@${{ secrets.HOST }} "cd ${{ secrets.WORK_DIR_PROD }} && docker image prune -f && docker compose pull && docker compose up -d && exit"
run: ssh ${{ secrets.USERNAME }}@${{ secrets.HOST }} "cd prod-minddaily && docker image prune -f && docker compose pull && docker compose up -d && exit"
- name: Cleanup 🧹
run: rm -rf ~/.ssh
8 changes: 4 additions & 4 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:

- name: Build Docker image 🐳
run: |
docker build -f docker/staging/Dockerfile . --tag ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_STAGE_IMAGE_NAME }}:latest
docker build -f docker/staging/Dockerfile . --tag ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_STAGE_IMAGE_NAME }}:latest
- name: Publish Docker image 📦
run: |
docker login -u ${{ secrets.DOCKER_REGISTRY }} -p ${{ secrets.DOCKER_HUB_TOKEN }}
docker push ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_STAGE_IMAGE_NAME }}
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker push ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_STAGE_IMAGE_NAME }}
deploy:
needs: build
Expand All @@ -34,6 +34,6 @@ jobs:
ssh-keyscan -H ${{ secrets.HOST }} > ~/.ssh/known_hosts
- name: Pull and run container 🏃️
run: ssh ${{ secrets.USERNAME }}@${{ secrets.HOST }} "cd ${{ secrets.WORK_DIR_STAGE }} && docker image prune -f && docker compose pull && docker compose up -d && exit"
run: ssh ${{ secrets.USERNAME }}@${{ secrets.HOST }} "cd stage-minddaily && docker image prune -f && docker compose pull && docker compose up -d && exit"
- name: Cleanup 🧹
run: rm -rf ~/.ssh

0 comments on commit 7abe7ba

Please sign in to comment.