From f0bae11ae56ad4c4ba489d1730315e7d9448d9ca Mon Sep 17 00:00:00 2001 From: asteriskzie Date: Wed, 24 Apr 2024 01:32:06 +0700 Subject: [PATCH] Update workflow again --- .github/workflows/cloud-run-action.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cloud-run-action.yaml b/.github/workflows/cloud-run-action.yaml index 24310a9..a0f0095 100644 --- a/.github/workflows/cloud-run-action.yaml +++ b/.github/workflows/cloud-run-action.yaml @@ -111,12 +111,15 @@ jobs: - name: create ssh key run: echo "${{ secrets.SSH_KEY }}" > ssh-key.pem - - name: update permission + - name: update permission ssh key run: chmod 400 ssh-key.pem + + - name: update permission user + run: chown -R ${{ secrets.GCP_USERNAME }}:${{ secrets.GCP_USERNAME }} /home/${{ secrets.GCP_USERNAME }}/.ssh - name: Deploy to GCP run: | - ssh -o StrictHostKeyChecking=no -vvv -i ssh-key.pem ${{ secrets.GCP_USERNAME }}@${{ secrets.GCP_STATIC_IP }} " + ssh -o StrictHostKeyChecking=no -i ssh-key.pem ${{ secrets.GCP_USERNAME }}@${{ secrets.GCP_STATIC_IP }} " sudo docker container rm -f ${{ secrets.CONTAINER_NAME }} || true && sudo docker image rm -f ${{ secrets.REGISTRY_USER }}/${{ secrets.IMAGE_NAME }}:${{ secrets.IMAGE_TAG }} || true && sudo docker run --name ${{ secrets.CONTAINER_NAME }} -d -p 80:8080 ${{ secrets.REGISTRY_USER }}/${{ secrets.IMAGE_NAME }}:${{ secrets.IMAGE_TAG }}" \ No newline at end of file