1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 03:58:28 -04:00

fix LHCI branch detection

This commit is contained in:
Jake Jarvis 2021-06-11 13:46:31 -04:00
parent 57ceac6a9e
commit 7db9c20af9
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39

View File

@ -11,7 +11,6 @@ jobs:
LHCI_TOKEN: ${{ secrets.LHCI_TOKEN }} LHCI_TOKEN: ${{ secrets.LHCI_TOKEN }}
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
LHCI_SERVER_BASE_URL: https://lhci.jrvs.io LHCI_SERVER_BASE_URL: https://lhci.jrvs.io
LHCI_BUILD_CONTEXT__CURRENT_BRANCH: ${{ github.event.deployment.ref }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
@ -22,22 +21,30 @@ jobs:
node-version: 14.x node-version: 14.x
- run: npm install -g @lhci/cli - run: npm install -g @lhci/cli
- run: | - run: |
lhci --version
lhci healthcheck lhci healthcheck
lhci --version
curl $LHCI_SERVER_BASE_URL/version curl $LHCI_SERVER_BASE_URL/version
echo ${{ github.event.deployment_status.target_url }} echo "ref: ${{ github.event.deployment.ref }}"
echo "env: ${{ github.event.deployment_status.environment }}"
echo "url: ${{ github.event.deployment_status.target_url }}"
- if: github.event.deployment_status.environment == 'production' - if: github.event.deployment_status.environment == 'production'
continue-on-error: true continue-on-error: true
env:
BASE_URL: https://jarv.is/
LHCI_BUILD_CONTEXT__CURRENT_BRANCH: main
run: | run: |
lhci autorun \ lhci autorun \
--collect.url=https://jarv.is/ \ --collect.url=$BASE_URL/ \
--collect.url=https://jarv.is/notes/how-to-pull-request-fork-github/ --collect.url=$BASE_URL/notes/how-to-pull-request-fork-github/
- if: github.event.deployment_status.environment == 'preview' - if: github.event.deployment_status.environment == 'preview'
continue-on-error: true continue-on-error: true
env:
BASE_URL: ${{ github.event.deployment_status.target_url }}
LHCI_BUILD_CONTEXT__CURRENT_BRANCH: ${{ github.event.deployment.ref }}
run: | run: |
lhci autorun \ lhci autorun \
--collect.url=${{ github.event.deployment_status.target_url }}/ \ --collect.url=$BASE_URL/ \
--collect.url=${{ github.event.deployment_status.target_url }}/notes/how-to-pull-request-fork-github/ --collect.url=$BASE_URL/notes/how-to-pull-request-fork-github/
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: lhci-results name: lhci-results