Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
[ci] Add ssh token for publishing gh-pages (#10338)
Browse files Browse the repository at this point in the history
* [ci] Added ssh token for publishing gh-pages

* changed ssh commands for gh-pages

* return github_token back to vault secrets

* check simnet-tests-quick without vault secrets

* remove vault secrets from simnet jobs
  • Loading branch information
alvicsam authored Nov 23, 2021
1 parent 7a531b0 commit 1d8f7bf
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ default:
GITHUB_PR_TOKEN:
vault: cicd/gitlab/parity/GITHUB_PR_TOKEN@kv
file: false
GITHUB_TOKEN:
vault: cicd/gitlab/parity/GITHUB_TOKEN@kv
file: false
AWS_ACCESS_KEY_ID:
vault: cicd/gitlab/$CI_PROJECT_PATH/AWS_ACCESS_KEY_ID@kv
file: false
Expand All @@ -228,9 +231,9 @@ default:
GITHUB_RELEASE_TOKEN:
vault: cicd/gitlab/$CI_PROJECT_PATH/GITHUB_RELEASE_TOKEN@kv
file: false
GITHUB_TOKEN:
vault: cicd/gitlab/$CI_PROJECT_PATH/GITHUB_TOKEN@kv
file: false
GITHUB_SSH_PRIV_KEY:
vault: cicd/gitlab/$CI_PROJECT_PATH/GITHUB_SSH_PRIV_KEY@kv
file: true
GITHUB_USER:
vault: cicd/gitlab/$CI_PROJECT_PATH/GITHUB_USER@kv
file: false
Expand Down Expand Up @@ -809,12 +812,14 @@ publish-rustdoc:
# Putting spaces at the front and back to ensure we are not matching just any substring, but the
# whole space-separated value.
- '[[ " ${RUSTDOCS_DEPLOY_REFS} " =~ " ${CI_COMMIT_REF_NAME} " ]] || exit 0'
# setup ssh
- apt-get update && apt-get install -y ssh
- rm -rf /tmp/*
# Set git config
- rm -rf .git/config
- git config core.sshCommand "ssh -i ${GITHUB_SSH_PRIV_KEY} -F /dev/null -o StrictHostKeyChecking=no"
- git config user.email "[email protected]"
- git config user.name "${GITHUB_USER}"
- git config remote.origin.url "https://${GITHUB_TOKEN}@github.com/paritytech/${CI_PROJECT_NAME}.git"
- 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
# Install `ejs` and generate index.html based on RUSTDOCS_DEPLOY_REFS
Expand Down Expand Up @@ -909,7 +914,6 @@ simnet-tests:
stage: deploy
image: docker.io/paritytech/simnet:${SIMNET_REF}
<<: *kubernetes-env
<<: *vault-secrets
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
Expand Down Expand Up @@ -939,7 +943,6 @@ simnet-tests-quick:
stage: deploy
image: docker.io/paritytech/simnet:${SIMNET_REF}
<<: *kubernetes-env
<<: *vault-secrets
<<: *test-refs-no-trigger-prs-only
variables:
SIMNET_FEATURES: "${SIMNET_FEATURES_PATH}/quick"
Expand Down

0 comments on commit 1d8f7bf

Please sign in to comment.