ci: Final CI fixes pass (#6556)
* Final CI fixes pass * Change cut to awk * Remove workflow_dispatch * Start, success, failure messges * Deploy from main and add comment * Update .github/workflows/2-deploy-to-staging.yml Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> * Update jobs to have correct comments, simplification in prod --------- Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
This commit is contained in:
parent
146c5f29cf
commit
10b156ff2b
24
.github/workflows/2-deploy-to-staging.yml
vendored
24
.github/workflows/2-deploy-to-staging.yml
vendored
@ -10,6 +10,16 @@ jobs:
|
|||||||
environment:
|
environment:
|
||||||
name: deploy/staging
|
name: deploy/staging
|
||||||
steps:
|
steps:
|
||||||
|
- name: Send Slack message that deploy is starting
|
||||||
|
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
|
||||||
|
with:
|
||||||
|
payload: |
|
||||||
|
{
|
||||||
|
"text": "Staging deploy started for branch: ${{ github.ref_name }}"
|
||||||
|
}
|
||||||
|
env:
|
||||||
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||||
|
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
- run: yarn prepare
|
- run: yarn prepare
|
||||||
@ -21,6 +31,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
- name: Update Cloudflare Pages deployment
|
- name: Update Cloudflare Pages deployment
|
||||||
|
id: pages-deployment
|
||||||
uses: cloudflare/pages-action@364c7ca09a4b57837c5967871d64a2c31adb8c0d
|
uses: cloudflare/pages-action@364c7ca09a4b57837c5967871d64a2c31adb8c0d
|
||||||
with:
|
with:
|
||||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
@ -28,6 +39,19 @@ jobs:
|
|||||||
projectName: interface-staging
|
projectName: interface-staging
|
||||||
directory: build
|
directory: build
|
||||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
# Cloudflare uses `main` as the default production branch, so we push using the `main` branch so that it can be aliased by a custom domain.
|
||||||
|
branch: main
|
||||||
|
- name: Send Slack message about deployment outcome
|
||||||
|
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
payload: |
|
||||||
|
{
|
||||||
|
"text": "Staging deploy **${{ steps.pages-deployment.outcome }}** for: ${{ github.ref_name }}"
|
||||||
|
}
|
||||||
|
env:
|
||||||
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||||
|
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
|
||||||
- name: Upload source maps to Sentry
|
- name: Upload source maps to Sentry
|
||||||
uses: getsentry/action-release@bd5f874fcda966ba48139b0140fb3ec0cb3aabdd
|
uses: getsentry/action-release@bd5f874fcda966ba48139b0140fb3ec0cb3aabdd
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
23
.github/workflows/4-deploy-to-prod.yml
vendored
23
.github/workflows/4-deploy-to-prod.yml
vendored
@ -10,6 +10,16 @@ jobs:
|
|||||||
environment:
|
environment:
|
||||||
name: deploy/prod
|
name: deploy/prod
|
||||||
steps:
|
steps:
|
||||||
|
- name: Send Slack message that build is starting
|
||||||
|
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
|
||||||
|
with:
|
||||||
|
payload: |
|
||||||
|
{
|
||||||
|
"text": "Production deploy started for branch: ${{ github.ref_name }}"
|
||||||
|
}
|
||||||
|
env:
|
||||||
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||||
|
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
- run: yarn prepare
|
- run: yarn prepare
|
||||||
@ -70,14 +80,27 @@ jobs:
|
|||||||
|
|
||||||
- name: Update Cloudflare Pages deployment
|
- name: Update Cloudflare Pages deployment
|
||||||
uses: cloudflare/pages-action@364c7ca09a4b57837c5967871d64a2c31adb8c0d
|
uses: cloudflare/pages-action@364c7ca09a4b57837c5967871d64a2c31adb8c0d
|
||||||
|
id: pages-deployment
|
||||||
with:
|
with:
|
||||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
|
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
|
||||||
directory: build
|
directory: build
|
||||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
# Cloudflare uses `main` as the default production branch, so we push using the `main` branch so that it can be aliased by a custom domain.
|
||||||
branch: main
|
branch: main
|
||||||
|
|
||||||
|
- name: Send Slack message about deployment outcome
|
||||||
|
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
payload: |
|
||||||
|
{
|
||||||
|
"text": "Production deploy **${{ steps.pages-deployment.outcome }}** for: ${{ github.ref_name }}"
|
||||||
|
}
|
||||||
|
env:
|
||||||
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||||
|
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
|
||||||
- name: Upload source maps to Sentry
|
- name: Upload source maps to Sentry
|
||||||
uses: getsentry/action-release@4744f6a65149f441c5f396d5b0877307c0db52c7
|
uses: getsentry/action-release@4744f6a65149f441c5f396d5b0877307c0db52c7
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
@ -11,8 +11,10 @@ name: Slack notifications for releases/* merges
|
|||||||
# | sed 's/"//g' | sed 's/\\t/;/g' | sed 's/\\n/;/g' | sed 's/\\//g' \
|
# | sed 's/"//g' | sed 's/\\t/;/g' | sed 's/\\n/;/g' | sed 's/\\//g' \
|
||||||
# We then use awk to format the TSV into a Slack message
|
# We then use awk to format the TSV into a Slack message
|
||||||
# | awk -F';' '{print "• <"$1"|"$2"> (<https://github.com/"$3"|"$3">, "$4") - "$5}' \
|
# | awk -F';' '{print "• <"$1"|"$2"> (<https://github.com/"$3"|"$3">, "$4") - "$5}' \
|
||||||
# Finally, we need to deal with some escaping issues with newlines so that we don't break the Slack message format
|
# We need to deal with some escaping issues with newlines so that we don't break the Slack message format
|
||||||
# | sed 's/$/\\n/g' | tr -d '\n' \
|
# | sed 's/$/\\n/g' | tr -d '\n' \
|
||||||
|
# Finally we have to truncate the message to 3,000 characters max, otherwise Slack will reject it
|
||||||
|
# | awk '{print substr($0,0,3000);}' \
|
||||||
# Then shove the bytes into a file to store them in their exact format
|
# Then shove the bytes into a file to store them in their exact format
|
||||||
# > /tmp/parsed_github_context
|
# > /tmp/parsed_github_context
|
||||||
|
|
||||||
@ -38,6 +40,7 @@ jobs:
|
|||||||
| sed 's/"//g' | sed 's/\\t/;/g' | sed 's/\\n/;/g' | sed 's/\\//g' \
|
| sed 's/"//g' | sed 's/\\t/;/g' | sed 's/\\n/;/g' | sed 's/\\//g' \
|
||||||
| awk -F';' '{print "• <"$1"|"$2"> (<https://github.com/"$3"|"$3">, "$4") - "$5}' \
|
| awk -F';' '{print "• <"$1"|"$2"> (<https://github.com/"$3"|"$3">, "$4") - "$5}' \
|
||||||
| sed 's/$/\\n/g' | tr -d '\n' \
|
| sed 's/$/\\n/g' | tr -d '\n' \
|
||||||
|
| awk '{print substr($0,0,3000);}' \
|
||||||
> /tmp/parsed_github_context
|
> /tmp/parsed_github_context
|
||||||
echo "SLACK_COMMITS=$(cat /tmp/parsed_github_context)" >> "$GITHUB_OUTPUT"
|
echo "SLACK_COMMITS=$(cat /tmp/parsed_github_context)" >> "$GITHUB_OUTPUT"
|
||||||
- name: Send custom JSON data to Slack workflow
|
- name: Send custom JSON data to Slack workflow
|
||||||
|
Loading…
Reference in New Issue
Block a user