mirror of https://gitlab.com/curben/blog
ci: update github mirror
This commit is contained in:
parent
d746b089ab
commit
e67014b813
|
@ -5,15 +5,33 @@ cache: # add cache to 'node_modules' for speeding up builds
|
||||||
- node_modules/ # Node modules and dependencies
|
- node_modules/ # Node modules and dependencies
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- apk update && apk add git
|
|
||||||
- npm install --only=prod -g npm
|
- npm install --only=prod -g npm
|
||||||
- npm install --only=prod
|
- npm install --only=prod
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
before_script:
|
||||||
|
- 'which ssh-agent || (apk update && apk add openssh-client git)'
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- npm install --only=prod snyk && npm run snyk # Refer to "scripts" in package.json
|
- npm install --only=prod snyk && npm run snyk # Refer to "scripts" in package.json
|
||||||
- npm run hexo
|
- npm run hexo
|
||||||
|
|
||||||
|
# Update github mirror
|
||||||
|
after_script:
|
||||||
|
# Import SSH key
|
||||||
|
- eval $(ssh-agent -s)
|
||||||
|
- echo "$GH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
|
||||||
|
- mkdir -p ~/.ssh
|
||||||
|
- chmod 700 ~/.ssh
|
||||||
|
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
|
||||||
|
- chmod 644 ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
# (workaround) force exit code 0
|
||||||
|
- ssh -T git@github.com || ":"
|
||||||
|
- git remote add mirror git@github.com:curbengh/blog.git
|
||||||
|
- git push mirror master
|
||||||
|
- git push mirror site
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
# Skip in renovate job
|
# Skip in renovate job
|
||||||
- if: '$RENOVATE == "true"'
|
- if: '$RENOVATE == "true"'
|
||||||
|
|
Loading…
Reference in New Issue