fix(ci): urls in comments (#3539)
Co-authored-by: Mikołaj Młodzikowski <mikolaj.mlodzikowski@github.com>
This commit is contained in:
parent
cf1f10e324
commit
2740df48a3
53
.github/workflows/ci-cd-trigger.yml
vendored
53
.github/workflows/ci-cd-trigger.yml
vendored
@ -105,19 +105,44 @@ jobs:
|
|||||||
affected="$(yarn nx print-affected --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --select=projects)"
|
affected="$(yarn nx print-affected --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --select=projects)"
|
||||||
echo -n "Affected projects: $affected"
|
echo -n "Affected projects: $affected"
|
||||||
|
|
||||||
|
branch_slug="$(echo ${{ github.head_ref || github.ref_name }} | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g )"
|
||||||
projects_e2e=""
|
projects_e2e=""
|
||||||
if [[ $affected == *"governance"* ]]; then projects_e2e+='"governance-e2e" '; fi
|
preview_governance="not deployed"
|
||||||
if [[ $affected == *"trading"* ]]; then projects_e2e+='"trading-e2e" '; fi
|
preview_trading="not deployed"
|
||||||
if [[ $affected == *"explorer"* ]]; then projects_e2e+='"explorer-e2e" '; fi
|
preview_explorer="not deployed"
|
||||||
if [[ -z "$projects_e2e" ]]; then projects_e2e+='"governance-e2e" "trading-e2e" "explorer-e2e" '; fi
|
if [[ -z "$projects_e2e" ]]; then
|
||||||
|
projects_e2e+='"governance-e2e" "trading-e2e" "explorer-e2e" '
|
||||||
|
preview_governance=$(printf "https://%s.%s.vega.rocks" "governance" "$branch_slug")
|
||||||
|
preview_trading=$(printf "https://%s.%s.vega.rocks" "trading" "$branch_slug")
|
||||||
|
preview_explorer=$(printf "https://%s.%s.vega.rocks" "explorer" "$branch_slug")
|
||||||
|
else
|
||||||
|
if [[ $affected == *"governance"* ]]; then
|
||||||
|
projects_e2e+='"governance-e2e" '
|
||||||
|
preview_governance=$(printf "https://%s.%s.vega.rocks" "governance" "$branch_slug")
|
||||||
|
fi
|
||||||
|
if [[ $affected == *"trading"* ]]; then
|
||||||
|
projects_e2e+='"trading-e2e" '
|
||||||
|
preview_trading=$(printf "https://%s.%s.vega.rocks" "trading" "$branch_slug")
|
||||||
|
fi
|
||||||
|
if [[ $affected == *"explorer"* ]]; then
|
||||||
|
projects_e2e+='"explorer-e2e" '
|
||||||
|
preview_explorer=$(printf "https://%s.%s.vega.rocks" "explorer" "$branch_slug")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
projects_e2e=${projects_e2e%?}
|
projects_e2e=${projects_e2e%?}
|
||||||
projects_e2e=[${projects_e2e// /,}]
|
projects_e2e=[${projects_e2e// /,}]
|
||||||
echo PROJECTS_E2E=$projects_e2e >> $GITHUB_ENV
|
echo PROJECTS_E2E=$projects_e2e >> $GITHUB_ENV
|
||||||
echo PROJECTS=$(echo $projects_e2e | sed 's|-e2e||g') >> $GITHUB_ENV
|
echo PROJECTS=$(echo $projects_e2e | sed 's|-e2e||g') >> $GITHUB_ENV
|
||||||
|
echo PREVIEW_GOVERNANCE=$preview_governance >> $GITHUB_ENV
|
||||||
|
echo PREVIEW_TRADING=$preview_trading >> $GITHUB_ENV
|
||||||
|
echo PREVIEW_EXPLORER=$preview_explorer >> $GITHUB_ENV
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
projects: ${{ env.PROJECTS }}
|
projects: ${{ env.PROJECTS }}
|
||||||
projects-e2e: ${{ env.PROJECTS_E2E }}
|
projects-e2e: ${{ env.PROJECTS_E2E }}
|
||||||
|
preview_governance: ${{ env.PREVIEW_GOVERNANCE }}
|
||||||
|
preview_trading: ${{ env.PREVIEW_TRADING }}
|
||||||
|
preview_explorer: ${{ env.PREVIEW_EXPLORER }}
|
||||||
|
|
||||||
cypress:
|
cypress:
|
||||||
needs: lint-test-build
|
needs: lint-test-build
|
||||||
@ -140,7 +165,9 @@ jobs:
|
|||||||
|
|
||||||
dist-check:
|
dist-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: publish-dist
|
needs:
|
||||||
|
- publish-dist
|
||||||
|
- lint-test-build
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
name: '(CD) comment preview links'
|
name: '(CD) comment preview links'
|
||||||
steps:
|
steps:
|
||||||
@ -151,22 +178,16 @@ jobs:
|
|||||||
issue-number: ${{ github.event.pull_request.number }}
|
issue-number: ${{ github.event.pull_request.number }}
|
||||||
body-includes: Previews
|
body-includes: Previews
|
||||||
|
|
||||||
- name: Inject slug/short variables
|
|
||||||
if: ${{ steps.fc.outputs.comment-id == 0 }}
|
|
||||||
uses: rlespinasse/github-slug-action@v4
|
|
||||||
with:
|
|
||||||
prefix: CI_
|
|
||||||
|
|
||||||
- name: Create comment
|
- name: Create comment
|
||||||
if: ${{ steps.fc.outputs.comment-id == 0 }}
|
|
||||||
uses: peter-evans/create-or-update-comment@v3
|
uses: peter-evans/create-or-update-comment@v3
|
||||||
|
if: ${{ steps.fc.outputs.comment-id == 0 }}
|
||||||
with:
|
with:
|
||||||
issue-number: ${{ github.event.pull_request.number }}
|
issue-number: ${{ github.event.pull_request.number }}
|
||||||
body: |
|
body: |
|
||||||
Previews
|
Previews:
|
||||||
- explorer https://explorer.${{ env.CI_GITHUB_REF_NAME }}.vega.rocks
|
* governance: ${{ needs.lint-test-build.outputs.preview_governance }}
|
||||||
- trading https://trading.${{ env.CI_GITHUB_REF_NAME }}.vega.rocks
|
* explorer: ${{ needs.lint-test-build.outputs.preview_explorer }}
|
||||||
- governance https://governance.${{ env.CI_GITHUB_REF_NAME }}.vega.rocks
|
* trading: ${{ needs.lint-test-build.outputs.preview_trading }}
|
||||||
|
|
||||||
cypress-check:
|
cypress-check:
|
||||||
name: '(CI) cypress - check'
|
name: '(CI) cypress - check'
|
||||||
|
Loading…
Reference in New Issue
Block a user