This commit is contained in:
PapaTutuWawa 2024-01-05 19:19:42 +01:00
parent f46273faac
commit c6285829d4

View File

@ -9,21 +9,15 @@ steps:
- ls -l - ls -l
deploy: deploy:
image: alpine:3.19 image: alpine:3.19
secrets: [ ssh_key, ssh_key_pub ] secrets: [ git_push_token ]
commands: commands:
- apk add --no-cache git openssh - apk add --no-cache git
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo $SSH_KEY > ~/.ssh/id_rsa
- echo $SSH_KEY_PUB > ~/.ssh/id_rsa.pub
- chmod 600 ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa.pub
- echo "[git.polynom.me]:2222 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDZgxMAkQvYOeEwDuWY3GlIKurqZpgFXrJfo/rhlJs+l8jOiOYbl2iZMtWBbW+eVArv6dne0EmcQPkGfz4hUlgtH3aePbe5WlPYCNck0xVvG9PJN8BS2vlTzE7djOEv/UaHNeTza/tGV5KD8BAGHnav2ky2nL0zitEQku7ww2IXO4A8JECUwy/a+nKZ21tZHhEcQFo1a0EsWkGHOyYISiFulEamsbEVq49ZpvFmlK0rY7Wsn1NiXJciWmTa5dyj02MWbbg189lN/G1UpA+zepD3hdLkw9gSxG8x4L6AGTxXGlSCjWi+jVItCiuTCdwJnqkvJogYhxtxIpPpxdClv4+H362baHWTDCoaiq7T1wiYYbIQiyxCVEgN2VohoeRH/m7K4W3Uk+5XWsGM9JRFrByFiviQDRm+Xj5QnxyQHBw8mFM1q2X2PMVaR/88HptOUoNcrn2C2C30CHCc6xU+za+fGessymuamrm1Yb7zsp9U3/MZZ7ez3mbHlwmQkOmmDJySsNgTgDaWVqbYR3bn0LVgKNrjP7mXBlIFTxf00feRj8ar9hz9BzUMGcDLAvhDxLvTdcpU7rpDcg958SHmd4Xc1cYf2zSY66/9KUXFePuMSfqztzMMmRzqkYyAXGlAhb3Yze2Cr/i+A9h6jKJ7KCelnnKvqFFmg6Jfx4WQXISemQ==" > ~/.ssh/known_hosts
- git config --global user.email "ci@polynom.me" - git config --global user.email "ci@polynom.me"
- git config --global user.name "polynom.me CI system" - git config --global user.name "polynom.me CI system"
- git config --global --add safe.directory $CI_WORKSPACE/$CI_REPO_OWNER/$CI_REPO_NAME/deploy - git config --global --add safe.directory $CI_WORKSPACE/$CI_REPO_OWNER/$CI_REPO_NAME/deploy
- git clone -b pages $CI_REPO_CLONE_SSH_URL deploy - git clone -b pages $CI_REPO_CLONE_URL deploy
- cd deploy - cd deploy
- git remote set-url origin https://$TOKEN@git.polynom.me/$CI_REPO_OWNER/$CI_REPO_NAME.git
- cp -rf ../public/* . - cp -rf ../public/* .
- git add --all - git add --all
- git commit -m "Deploy new version $CI_COMMIT_SHA" - git commit -m "Deploy new version $CI_COMMIT_SHA"