Skip to content

Commit

Permalink
Update workflow again
Browse files Browse the repository at this point in the history
  • Loading branch information
asteriskzie committed Apr 23, 2024
1 parent 202da45 commit f0bae11
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/cloud-run-action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"

0 comments on commit f0bae11

Please sign in to comment.