chore(release): Test v7.25.3 #29
Workflow file for this run
This file contains 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
name: Release to Production | |
on: | |
pull_request: | |
branches: | |
- production | |
types: [closed] | |
jobs: | |
release: | |
if: ${{ github.event.pull_request.merged == true }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: "read" | |
id-token: "write" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get Job ID from PR | |
run: | | |
cat > BODY <<'EOF' | |
${{ github.event.pull_request.body}} | |
EOF | |
JOB_ID=$(cat BODY | perl -ne 'print "$1\n" and exit if m/Production Job Id:\s(\w+)/;') | |
echo "JOB_ID=${JOB_ID}" >> $GITHUB_ENV | |
- name: Push to Production Server | |
uses: nick-fields/retry@v2 | |
with: | |
timeout_minutes: 5 | |
max_attempts: 100 | |
retry_wait_seconds: 5 | |
# If the job isn't created yet, will return {"message":"400 Bad request - Unplayable Job"} | |
command: | | |
RES=$(curl "https://gitlab.com/api/v4/projects/${{ vars.GITLAB_PROJECT_ID }}/jobs/${{ env.JOB_ID }}/play" \ | |
--request POST \ | |
--header 'PRIVATE-TOKEN: ${{ secrets.GITLAB_DEPLOYMENT_ACCESS_TOKEN }}') | |
echo $RES | |
JOB_ID_DONE=$(echo $RES | jq '.id // empty') | |
[ -z "$JOB_ID_DONE" ] && exit 1 || exit 0 | |
- name: Poll Production Release | |
uses: artiz/poll-endpoint@1.0.2 | |
with: | |
url: https://gitlab.com/api/v4/projects/${{ vars.GITLAB_PROJECT_ID }}/jobs/${{ env.JOB_ID }}?access_token=${{ secrets.GITLAB_DEPLOYMENT_ACCESS_TOKEN }} | |
method: GET | |
expect-status: 200 | |
expect-response-regex: '"status":"success"' | |
timeout: 120000 | |
interval: 3000 |