add deployment to CI
This commit is contained in:
parent
41b0483b10
commit
a8c4bc5756
1 changed files with 23 additions and 0 deletions
23
.github/workflows/ci.yaml
vendored
23
.github/workflows/ci.yaml
vendored
|
@ -27,3 +27,26 @@ jobs:
|
|||
if: github.ref == 'refs/heads/main'
|
||||
- run: |
|
||||
docker push ghcr.io/${{ github.repository }}/${{ matrix.service }}
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: github.ref == 'refs/heads/main'
|
||||
environment:
|
||||
name: production
|
||||
url: https://saerro.harasse.rs
|
||||
permissions:
|
||||
contents: "read"
|
||||
id-token: "write"
|
||||
steps:
|
||||
- id: "auth"
|
||||
uses: "google-github-actions/auth@v1"
|
||||
with:
|
||||
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
|
||||
service_account: ${{ secrets.SERVICE_ACCOUNT }}
|
||||
|
||||
- name: "Set up Cloud SDK"
|
||||
uses: "google-github-actions/setup-gcloud@v1"
|
||||
|
||||
- name: "Deploy"
|
||||
run: |
|
||||
gcloud compute ssh ${{ secrets.VM_NAME }} --zone=us-central1-a --command "cd /opt && sudo docker compose pull && sudo docker compose up -d"
|
||||
|
|
Loading…
Add table
Reference in a new issue