[Feature] Promote release deployment baseline#108
Merged
Merged
Conversation
Add Tencent main/release deployment workflow, release docs, and release policy metadata.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Comment on lines
+16
to
+75
| name: Deploy Web | ||
| runs-on: [self-hosted, linux, x64, tencent, meteortest] | ||
| environment: tencent | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Resolve target | ||
| id: target | ||
| shell: bash | ||
| run: | | ||
| if [ "${GITHUB_REF_NAME}" = "release" ]; then | ||
| echo "app_dir=/srv/meteortest-release" >> "$GITHUB_OUTPUT" | ||
| echo "pm2_name=meteortest-release" >> "$GITHUB_OUTPUT" | ||
| echo "port=3300" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "app_dir=/srv/meteortest" >> "$GITHUB_OUTPUT" | ||
| echo "pm2_name=meteortest-web" >> "$GITHUB_OUTPUT" | ||
| echo "port=3301" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Deploy | ||
| shell: bash | ||
| run: | | ||
| retry() { | ||
| local attempts="$1" | ||
| local delay="$2" | ||
| shift 2 | ||
|
|
||
| local attempt=1 | ||
| until "$@"; do | ||
| if [ "$attempt" -ge "$attempts" ]; then | ||
| return 1 | ||
| fi | ||
|
|
||
| echo "Command failed. Retrying in ${delay}s (${attempt}/${attempts})..." | ||
| sleep "$delay" | ||
| attempt=$((attempt + 1)) | ||
| done | ||
| } | ||
|
|
||
| mkdir -p '${{ steps.target.outputs.app_dir }}' | ||
| rsync -a --delete \ | ||
| --exclude '.git' \ | ||
| --exclude 'apps/web/.next' \ | ||
| --exclude 'apps/web/node_modules' \ | ||
| ./ '${{ steps.target.outputs.app_dir }}/' | ||
|
|
||
| cd '${{ steps.target.outputs.app_dir }}/apps/web' | ||
| retry 3 15 npm ci | ||
| set -a | ||
| . /etc/meteortest/meteortest-web.env | ||
| set +a | ||
| retry 2 15 npm run build | ||
|
|
||
| pm2 delete '${{ steps.target.outputs.pm2_name }}' || true | ||
| unset RUNNER_TRACKING_ID | ||
| pm2 start npm --name '${{ steps.target.outputs.pm2_name }}' -- run start -- --hostname 127.0.0.1 --port '${{ steps.target.outputs.port }}' | ||
| pm2 save | ||
| retry 12 5 curl -fsS 'http://127.0.0.1:${{ steps.target.outputs.port }}/' >/dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Promote the Tencent release deployment track from main into the release branch.
Proposed Changes
Test Plan