Skip to content

Commit 1502272

Browse files
authored
Merge pull request #47 from appwrite/deploy-default-yaml
ci: point deployment pipelines at default.yaml
2 parents 1fe1c72 + 41ddd34 commit 1502272

2 files changed

Lines changed: 35 additions & 11 deletions

File tree

.github/workflows/production.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ env:
2121
REGISTRY_GITHUB: ghcr.io
2222
REGISTRY_DOCKERHUB: docker.io
2323
IMAGE_NAME: appwrite/mcp
24-
TAG: ${{ github.event.release.tag_name || github.sha }}
24+
TAG: ${{ github.event.release.tag_name }}
2525

2626
jobs:
2727
build:
@@ -56,6 +56,9 @@ jobs:
5656
deploy:
5757
needs: build
5858
runs-on: ubuntu-latest
59+
concurrency:
60+
group: declarative-deploy
61+
cancel-in-progress: false
5962
steps:
6063
- name: Get token for ${{ env.DECLARATIVE_REPOSITORY }}
6164
id: app-token
@@ -73,16 +76,25 @@ jobs:
7376
token: ${{ steps.app-token.outputs.token }}
7477

7578
- name: Update image tag
76-
run: yq -i '.["mcp"].image.tag = strenv(TAG)' ${{ env.ENVIRONMENT }}/${{ env.PROJECT }}/fra1.yaml
79+
run: yq -i '.["mcp"].image.tag = strenv(TAG)' ${{ env.ENVIRONMENT }}/${{ env.PROJECT }}/default.yaml
7780

7881
- name: Commit and push
7982
run: |
8083
git config user.name "github-actions[bot]"
8184
git config user.email "github-actions[bot]@users.noreply.github.com"
82-
git add ${{ env.ENVIRONMENT }}/${{ env.PROJECT }}/fra1.yaml
85+
git add ${{ env.ENVIRONMENT }}/${{ env.PROJECT }}/default.yaml
8386
if git diff --cached --quiet; then
8487
echo "No changes to commit"
85-
else
86-
git commit -m "chore(${{ env.ENVIRONMENT }}): ${{ env.PROJECT }} image tag to ${{ env.TAG }}"
87-
git push
88+
exit 0
8889
fi
90+
git commit -m "chore(${{ env.ENVIRONMENT }}): ${{ env.PROJECT }} image tag to ${{ env.TAG }}"
91+
for attempt in 1 2 3 4 5; do
92+
if git push; then
93+
echo "Pushed on attempt $attempt"
94+
exit 0
95+
fi
96+
echo "Push rejected (attempt $attempt), rebasing onto remote and retrying..."
97+
git pull --rebase
98+
done
99+
echo "Failed to push after 5 attempts"
100+
exit 1

.github/workflows/staging.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ jobs:
5757
deploy:
5858
needs: build
5959
runs-on: ubuntu-latest
60+
concurrency:
61+
group: declarative-deploy
62+
cancel-in-progress: false
6063
steps:
6164
- name: Get token for ${{ env.DECLARATIVE_REPOSITORY }}
6265
id: app-token
@@ -74,16 +77,25 @@ jobs:
7477
token: ${{ steps.app-token.outputs.token }}
7578

7679
- name: Update image tag
77-
run: yq -i '.["mcp"].image.tag = strenv(TAG)' ${{ env.ENVIRONMENT }}/${{ env.PROJECT }}/fra1.yaml
80+
run: yq -i '.["mcp"].image.tag = strenv(TAG)' ${{ env.ENVIRONMENT }}/${{ env.PROJECT }}/default.yaml
7881

7982
- name: Commit and push
8083
run: |
8184
git config user.name "github-actions[bot]"
8285
git config user.email "github-actions[bot]@users.noreply.github.com"
83-
git add ${{ env.ENVIRONMENT }}/${{ env.PROJECT }}/fra1.yaml
86+
git add ${{ env.ENVIRONMENT }}/${{ env.PROJECT }}/default.yaml
8487
if git diff --cached --quiet; then
8588
echo "No changes to commit"
86-
else
87-
git commit -m "chore(${{ env.ENVIRONMENT }}): ${{ env.PROJECT }} image tag to ${{ env.TAG }}"
88-
git push
89+
exit 0
8990
fi
91+
git commit -m "chore(${{ env.ENVIRONMENT }}): ${{ env.PROJECT }} image tag to ${{ env.TAG }}"
92+
for attempt in 1 2 3 4 5; do
93+
if git push; then
94+
echo "Pushed on attempt $attempt"
95+
exit 0
96+
fi
97+
echo "Push rejected (attempt $attempt), rebasing onto remote and retrying..."
98+
git pull --rebase
99+
done
100+
echo "Failed to push after 5 attempts"
101+
exit 1

0 commit comments

Comments
 (0)