Skip to content

Commit

Permalink
main_pipeline.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
slepp22 authored Apr 27, 2024
1 parent 4bfeca7 commit e2340f3
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy to Google Cloud Run

on:
push:
branches:
- main # Adjust the branch name as needed

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build and push Docker image
run: |
docker buildx build -t sleppp/inventory-backend --platform linux/amd64 .
docker tag sleppp/inventory-backend gcr.io/inventory-database-420916/inventory-backend
docker push gcr.io/inventory-database-420916/inventory-backend:latest
- name: Set up Google Cloud SDK
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true

- name: Deploy to Cloud Run
run: |
gcloud run deploy inventory-backend \
--image gcr.io/inventory-database-420916/inventory-backend \
--platform managed \
--region us-central1 \
--allow-unauthenticated

0 comments on commit e2340f3

Please sign in to comment.