Trying to fix it
Some checks failed
Build Docker Image and Deploy / Build Image and push to Registry (push) Failing after 27s
Build Docker Image and Deploy / Deploy on webserver (push) Has been skipped

This commit is contained in:
Cyril Šebek 2024-07-07 21:32:35 +02:00
parent f5f1dd2d81
commit 48efb49a04
Signed by: blboun3
SSH Key Fingerprint: SHA256:n9dMtOPzgsD+CCerUJslEnU2dzVanbaIv0XDQVRVjeg
2 changed files with 7 additions and 7 deletions

View File

@ -62,14 +62,14 @@ jobs:
ssh-private-key: ${{ secrets.SSH_PRIV_KEY }}
- name: Login to registry
run: ssh ${{ vars.TARGET_USER }}@${{ vars.TARGET }} "docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} ${{ vars.REGISTRY }}"
run: ssh ${{ vars.TARGET_USER }}@${{ vars.TARGET }} -o StrictHostKeyChecking=no "docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} ${{ vars.REGISTRY }}"
- name: Pull new image
run: ssh ${{ vars.TARGET_USER }}@{{ vars.TARGET }} "docker pull ${{ vars.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
run: ssh ${{ vars.TARGET_USER }}@{{ vars.TARGET }} -o StrictHostKeyChecking=no "docker pull ${{ vars.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
- name: Logout from registry
run: ssh ${{ vars.TARGET_USER }}@{{ vars.TARGET }} "docker logout ${{ vars.REGISTRY }}"
run: ssh ${{ vars.TARGET_USER }}@{{ vars.TARGET }} -o StrictHostKeyChecking=no "docker logout ${{ vars.REGISTRY }}"
- name: Stop and Remove the container
run: ssh ${{ vars.TARGET_USER }}@{{ vars.TARGET }} "docker stop ${{ env.IMAGE_NAME }} && docker remove ${{ env.IMAGE_NAME }}"
run: ssh ${{ vars.TARGET_USER }}@{{ vars.TARGET }} -o StrictHostKeyChecking=no "docker stop ${{ env.IMAGE_NAME }} && docker remove ${{ env.IMAGE_NAME }}"
- name: Recreate the container
run: ssh ${{ vars.TARGET_USER }}@{{ vars.TARGET }} "docker run --name=${{ env.IMAGE_NAME }} ${{ env.IMAGE_NAME }}:latest"
run: ssh ${{ vars.TARGET_USER }}@{{ vars.TARGET }} -o StrictHostKeyChecking=no "docker run --name=${{ env.IMAGE_NAME }} ${{ env.IMAGE_NAME }}:latest"
- name: Clean old images
run: ssh ${{ vars.TARGET_USER }}@{{ vars.TARGET }} "docker image prune -a"
run: ssh ${{ vars.TARGET_USER }}@{{ vars.TARGET }} -o StrictHostKeyChecking=no "docker image prune -a"

View File

@ -19,7 +19,7 @@ WORKDIR /app
COPY --from=build /app/dist /app/dist
COPY --from=build /app/package.json /app/package.json
COPY --from=build /app/package-lock.json /app/package-lock.json
COPY --from=build /app/pnpm-lock.json /app/pnpm-lock.json
RUN pnpm install --frozen-lockfile
EXPOSE 4321