Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 1 addition & 32 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,8 @@ env:
CODEDEPLOY_DEPLOYMENT_GROUP: weplate-deploy-group

jobs:
check-main-updated:
deploy:
runs-on: ubuntu-latest
outputs:
should_deploy: ${{ steps.compare.outputs.should_deploy }}
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main

- name: Compare main with origin/main
id: compare
run: |
git remote set-url origin https://github.com/${{ github.repository }}.git
git fetch origin main
LOCAL_SHA=$(git rev-parse HEAD)
REMOTE_SHA=$(git rev-parse origin/main)

echo "📟 Local HEAD: $LOCAL_SHA"
echo "📟 Remote HEAD: $REMOTE_SHA"

if [ "$LOCAL_SHA" = "$REMOTE_SHA" ]; then
echo "✅ No changes. Skipping deploy."
echo "should_deploy=false" >> $GITHUB_OUTPUT
else
echo "🚀 Main branch changed. Proceeding with deploy."
echo "should_deploy=true" >> $GITHUB_OUTPUT

deploy-if-updated:
runs-on: ubuntu-latest
needs: check-main-updated
if: needs.check-main-updated.outputs.should_deploy == 'true'
steps:
- name: Checkout main
uses: actions/checkout@v4
Expand Down
27 changes: 26 additions & 1 deletion docker-compose.template.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
version: '3.8'
services:
client-weplate:
container_name: client-weplate
Expand All @@ -8,6 +8,11 @@ services:
image: $ECR_REGISTRY/weplate/client-weplate:$VERSION
ports:
- "1111:1111"
deploy:
resources:
limits:
cpus: '0.5'
memory: 1024M

server-api:
container_name: server-api
Expand All @@ -17,6 +22,11 @@ services:
image: $ECR_REGISTRY/weplate/server-api:$VERSION
ports:
- "7777:7777"
deploy:
resources:
limits:
cpus: '0.25'
memory: 512M

server-auth:
container_name: server-auth
Expand All @@ -26,6 +36,11 @@ services:
image: $ECR_REGISTRY/weplate/server-auth:$VERSION
ports:
- "5555:5555"
deploy:
resources:
limits:
cpus: '0.25'
memory: 512M

nginx:
container_name: nginx
Expand All @@ -37,6 +52,11 @@ services:
- client-weplate
- server-api
- server-auth
deploy:
resources:
limits:
cpus: '0.1'
memory: 256M

nginx-health-check:
container_name: nginx-health-check
Expand All @@ -48,3 +68,8 @@ services:
- client-weplate
- server-api
- server-auth
deploy:
resources:
limits:
cpus: '0.1'
memory: 256M
Loading