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

Commit 1d8f7bf

Browse files
authored
[ci] Add ssh token for publishing gh-pages (#10338)
* [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
1 parent 7a531b0 commit 1d8f7bf

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

.gitlab-ci.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ default:
204204
GITHUB_PR_TOKEN:
205205
vault: cicd/gitlab/parity/GITHUB_PR_TOKEN@kv
206206
file: false
207+
GITHUB_TOKEN:
208+
vault: cicd/gitlab/parity/GITHUB_TOKEN@kv
209+
file: false
207210
AWS_ACCESS_KEY_ID:
208211
vault: cicd/gitlab/$CI_PROJECT_PATH/AWS_ACCESS_KEY_ID@kv
209212
file: false
@@ -228,9 +231,9 @@ default:
228231
GITHUB_RELEASE_TOKEN:
229232
vault: cicd/gitlab/$CI_PROJECT_PATH/GITHUB_RELEASE_TOKEN@kv
230233
file: false
231-
GITHUB_TOKEN:
232-
vault: cicd/gitlab/$CI_PROJECT_PATH/GITHUB_TOKEN@kv
233-
file: false
234+
GITHUB_SSH_PRIV_KEY:
235+
vault: cicd/gitlab/$CI_PROJECT_PATH/GITHUB_SSH_PRIV_KEY@kv
236+
file: true
234237
GITHUB_USER:
235238
vault: cicd/gitlab/$CI_PROJECT_PATH/GITHUB_USER@kv
236239
file: false
@@ -809,12 +812,14 @@ publish-rustdoc:
809812
# Putting spaces at the front and back to ensure we are not matching just any substring, but the
810813
# whole space-separated value.
811814
- '[[ " ${RUSTDOCS_DEPLOY_REFS} " =~ " ${CI_COMMIT_REF_NAME} " ]] || exit 0'
815+
# setup ssh
816+
- apt-get update && apt-get install -y ssh
812817
- rm -rf /tmp/*
813818
# Set git config
814-
- rm -rf .git/config
819+
- git config core.sshCommand "ssh -i ${GITHUB_SSH_PRIV_KEY} -F /dev/null -o StrictHostKeyChecking=no"
815820
- git config user.email "[email protected]"
816821
- git config user.name "${GITHUB_USER}"
817-
- git config remote.origin.url "https://${GITHUB_TOKEN}@github.com/paritytech/${CI_PROJECT_NAME}.git"
822+
- git config remote.origin.url "git@github.com:/paritytech/${CI_PROJECT_NAME}.git"
818823
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
819824
- git fetch origin gh-pages
820825
# Install `ejs` and generate index.html based on RUSTDOCS_DEPLOY_REFS
@@ -909,7 +914,6 @@ simnet-tests:
909914
stage: deploy
910915
image: docker.io/paritytech/simnet:${SIMNET_REF}
911916
<<: *kubernetes-env
912-
<<: *vault-secrets
913917
rules:
914918
- if: $CI_PIPELINE_SOURCE == "pipeline"
915919
when: never
@@ -939,7 +943,6 @@ simnet-tests-quick:
939943
stage: deploy
940944
image: docker.io/paritytech/simnet:${SIMNET_REF}
941945
<<: *kubernetes-env
942-
<<: *vault-secrets
943946
<<: *test-refs-no-trigger-prs-only
944947
variables:
945948
SIMNET_FEATURES: "${SIMNET_FEATURES_PATH}/quick"

0 commit comments

Comments
 (0)