[ci] fix subsystem-benchmarks gha (#3876)

PR adds variables validation and app credentials for pushing into
gh-pages

cc https://github.com/paritytech/ci_cd/issues/934
This commit is contained in:
Alexander Samusev
2024-03-28 17:42:20 +01:00
committed by GitHub
parent c106dbd095
commit eb6f5abee6
+14 -2
View File
@@ -15,7 +15,13 @@ on:
jobs:
subsystem-benchmarks:
runs-on: ubuntu-latest
environment: subsystem-benchmarks
steps:
- name: Validate inputs
run: |
echo "${{ github.event.inputs.benchmark-data-dir-path }}" | grep -P '^[a-z\-]'
echo "${{ github.event.inputs.output-file-path }}" | grep -P '^[a-z\-]+\.json'
- name: Checkout Sources
uses: actions/checkout@v4.1.2
with:
@@ -30,7 +36,13 @@ jobs:
- name: Switch branch
id: step_two
run: |
git checkout master
git checkout master --
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.POLKADOTSDK_GHPAGES_APP_ID }}
private-key: ${{ secrets.POLKADOTSDK_GHPAGES_APP_KEY }}
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
@@ -38,5 +50,5 @@ jobs:
tool: "customSmallerIsBetter"
output-file-path: ${{ github.event.inputs.output-file-path }}
benchmark-data-dir-path: "bench/${{ github.event.inputs.benchmark-data-dir-path }}"
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ steps.app-token.outputs.token }}
auto-push: true