This commit is contained in:
1 parent
3061bc4d1b
commit
c7e949b074
1 file changed
+13
-1
@@ -20,14 +20,26 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
shell: bash
|
shell: bash
|
||||||
|
env:
|
||||||
|
GITEA_SSH_PRIVATE_KEY: ${{ secrets.GITEA_SSH_PRIVATE_KEY }}
|
||||||
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
|
||||||
run: |
|
run: |
|
||||||
git init .
|
git init .
|
||||||
|
checkout_key="${GITEA_SSH_PRIVATE_KEY:-${SSH_PRIVATE_KEY:-${DEPLOY_KEY:-}}}"
|
||||||
|
if [[ -z "$checkout_key" ]]; then
|
||||||
|
echo "::error::No global SSH checkout key found. Configure GITEA_SSH_PRIVATE_KEY, SSH_PRIVATE_KEY, or DEPLOY_KEY."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
chmod 700 ~/.ssh
|
chmod 700 ~/.ssh
|
||||||
|
printf '%s\n' "$checkout_key" > ~/.ssh/id_ed25519
|
||||||
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
ssh-keyscan -p 2222 git.k2patel.in >> ~/.ssh/known_hosts
|
ssh-keyscan -p 2222 git.k2patel.in >> ~/.ssh/known_hosts
|
||||||
chmod 600 ~/.ssh/known_hosts
|
chmod 600 ~/.ssh/known_hosts
|
||||||
git remote add origin "ssh://git@git.k2patel.in:2222/k2patel/apcupsd-client.git"
|
git remote add origin "ssh://git@git.k2patel.in:2222/k2patel/apcupsd-client.git"
|
||||||
git -c protocol.version=2 fetch --no-tags --prune --depth=1 origin +refs/heads/main:refs/remotes/origin/main
|
GIT_SSH_COMMAND="ssh -i ~/.ssh/id_ed25519 -o IdentitiesOnly=yes" \
|
||||||
|
git -c protocol.version=2 fetch --no-tags --prune --depth=1 origin +refs/heads/main:refs/remotes/origin/main
|
||||||
git checkout --force refs/remotes/origin/main
|
git checkout --force refs/remotes/origin/main
|
||||||
|
|
||||||
- name: Determine image tag
|
- name: Determine image tag
|
||||||
|
|||||||
Reference in new issue
Block a user