Skip to content

Commit

Permalink
Fix Azamat's code
Browse files Browse the repository at this point in the history
Fix Azamat's code
  • Loading branch information
AzamatKomaev authored Oct 15, 2024
1 parent f307205 commit 677bc94
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,20 @@ jobs:
registry: ${{ env.REGISTRY_URL }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Add custom builder
run: |
docker buildx create \
--name container-builder \
--driver docker-container \
--bootstrap --use
- name: Build & Publish backend to Github Container registry
run: |
docker build --platform linux/amd64,linux/arm64 ./backend --tag $REGISTRY_URL/$REGISTRY_USERNAME/yet_another_calendar_backend:latest \
--tag $REGISTRY_URL/$REGISTRY_USERNAME/yet_another_calendar_backend:$IMAGE_TAG
docker push $REGISTRY_URL/$REGISTRY_USERNAME/yet_another_calendar_backend:latest
docker push $REGISTRY_URL/$REGISTRY_USERNAME/yet_another_calendar_backend:$IMAGE_TAG
docker buildx build --platform linux/amd64,linux/arm64 --push ./backend \
--tag $REGISTRY_URL/$REGISTRY_USERNAME/yet_another_calendar_backend:latest \
--tag $REGISTRY_URL/$REGISTRY_USERNAME/yet_another_calendar_backend:$IMAGE_TAG
- name: Build & Publish frontend to Github Container registry
run: |
docker build --platform linux/amd64,linux/arm64 ./frontend --tag $REGISTRY_URL/$REGISTRY_USERNAME/yet_another_calendar_frontend:latest \
--tag $REGISTRY_URL/$REGISTRY_USERNAME/yet_another_calendar_frontend:$IMAGE_TAG
docker push $REGISTRY_URL/$REGISTRY_USERNAME/yet_another_calendar_frontend:latest
docker push $REGISTRY_URL/$REGISTRY_USERNAME/yet_another_calendar_frontend:$IMAGE_TAG
docker buildx build --platform linux/amd64,linux/arm64 --push ./frontend \
--tag $REGISTRY_URL/$REGISTRY_USERNAME/yet_another_calendar_frontend:latest \
--tag $REGISTRY_URL/$REGISTRY_USERNAME/yet_another_calendar_frontend:$IMAGE_TAG
12 changes: 8 additions & 4 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ jobs:
- run: ssh-keyscan -p $SSH_PORT $SSH_HOST >> ~/.ssh/known_hosts
- run: ssh-agent -a $SSH_AUTH_SOCK > /dev/null
- run: ssh-add - <<< "${{ secrets.SSH_KEY }}"

- name: Add image tag to .version file
run: |
echo $IMAGE_TAG > .version
scp -P 666 .version $SSH_USER@$SSH_HOST:~/YetAnotherCalendar/.version
- name: Update docker compose
run: |
ssh $SSH_USER@$SSH_HOST -p $SSH_PORT "cd YetAnotherCalendar/ &&
YET_ANOTHER_CALENDAR_VERSION=$IMAGE_TAG docker compose -f docker-compose.prod.yaml pull
YET_ANOTHER_CALENDAR_VERSION=$IMAGE_TAG docker compose -f docker-compose.prod.yaml up -d"
ssh $SSH_USER@$SSH_HOST -p $SSH_PORT "cd YetAnotherCalendar/ && git pull origin main
YET_ANOTHER_CALENDAR_VERSION=$(cat .version) docker compose -f docker-compose.prod.yaml pull
YET_ANOTHER_CALENDAR_VERSION=$(cat .version) docker compose -f docker-compose.prod.yaml up -d"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
.version

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down

0 comments on commit 677bc94

Please sign in to comment.