diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index e35ff9b..450019b 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -6,10 +6,27 @@ on: jobs: deploy: + permissions: + contents: 'read' + id-token: 'write' + name: Deploy runs-on: ubuntu-latest steps: + - id: 'auth' + uses: 'google-github-actions/auth@v2' + with: + credentials_json: '${{ secrets.GCP_CREDENTIALS }}' + + - name: 'Set up Cloud SDK' + uses: 'google-github-actions/setup-gcloud@v2' + with: + version: '>= 363.0.0' + + - name: 'Use gcloud CLI' + run: 'gcloud info' + - name: Check out code uses: actions/checkout@v4 @@ -19,4 +36,7 @@ jobs: go-version: "1.23.0" - name: Build - run: scripts/buildprod.sh \ No newline at end of file + run: scripts/buildprod.sh + + - name: Push to Google + run: gcloud builds submit --tag us-central1-docker.pkg.dev/notely-453912/notely-ar-repo/notely:latest . \ No newline at end of file