Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add job to publish benchmark results to gh-pages #603

Merged
merged 3 commits into from
Dec 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ variables: &default-vars

.vault-secrets: &vault-secrets
secrets:
GITHUB_TOKEN:
vault: cicd/gitlab/parity/GITHUB_TOKEN@kv
GITHUB_SSH_PRIV_KEY:
vault: cicd/gitlab/parity/${CI_PROJECT_NAME}/GITHUB_SSH_PRIV_KEY@kv
file: false
GITHUB_USER:
vault: cicd/gitlab/parity/GITHUB_USER@kv
Expand Down Expand Up @@ -134,6 +134,39 @@ benchmarks:
tags:
- linux-docker-benches

publish-ghpages:
stage: publish
variables:
CI_IMAGE: "paritytech/tools:latest"
<<: *kubernetes-env
<<: *schedule-refs
<<: *vault-secrets
needs:
- job: benchmarks
artifacts: true
script:
- mv artifacts/output.txt /tmp/output.txt
# setup ssh
- eval $(ssh-agent)
- ssh-add - <<< ${GITHUB_SSH_PRIV_KEY}
- mkdir ~/.ssh && touch ~/.ssh/known_hosts
- ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
# Set git config
- rm -rf .git/config
- git config user.email "devops-team@parity.io"
- git config user.name "${GITHUB_USER}"
- git config remote.origin.url "git@github.com:/paritytech/${CI_PROJECT_NAME}.git"
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch origin gh-pages
# Push result to github
- git checkout gh-pages
- mkdir bench/$(date +%d-%m-%Y) || echo "Directory exists"
- mv /tmp/output.txt bench/$(date +%d-%m-%Y)/
- git add --all
- git commit -m "Add output.txt with benchmark results for ${CI_COMMIT_REF_NAME}"
- git push origin gh-pages
allow_failure: true

publish-bench:
stage: publish
variables:
Expand Down