Add private key in secrets
This commit is contained in:
parent
393bdae782
commit
e98b9ff6d7
2
.github/workflows/cicd.yml
vendored
2
.github/workflows/cicd.yml
vendored
@ -30,6 +30,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
|
build-args: |
|
||||||
|
SSH_PRIVATE_KEY=${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ gitea.sha }}
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ gitea.sha }}
|
11
Dockerfile
11
Dockerfile
@ -8,10 +8,13 @@ COPY .env ./
|
|||||||
|
|
||||||
RUN apk update && apk add openssh-client git
|
RUN apk update && apk add openssh-client git
|
||||||
|
|
||||||
COPY id_rsa /root/.ssh/id_rsa
|
ARG SSH_PRIVATE_KEY
|
||||||
RUN chmod 600 ~/.ssh/id_rsa
|
RUN mkdir -p /root/.ssh && \
|
||||||
RUN eval "$(ssh-agent -s)" && ssh-add /root/.ssh/id_rsa
|
echo "${SSH_PRIVATE_KEY}" > /root/.ssh/id_rsa && \
|
||||||
RUN ssh-keyscan git.4nkweb.com >> /root/.ssh/known_hosts
|
chmod 600 /root/.ssh/id_rsa && \
|
||||||
|
eval "$(ssh-agent -s)" && \
|
||||||
|
ssh-add /root/.ssh/id_rsa && \
|
||||||
|
ssh-keyscan git.4nkweb.com >> /root/.ssh/known_hosts
|
||||||
|
|
||||||
RUN npm install --frozen-lockfile
|
RUN npm install --frozen-lockfile
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user