mirror of
https://github.com/harry0703/MoneyPrinterTurbo.git
synced 2026-02-27 11:27:21 +08:00
feat(deploy): add gcp deploy
This commit is contained in:
parent
a7c45b125f
commit
ffe3fb4419
40
.github/workflows/deploy.yml
vendored
Normal file
40
.github/workflows/deploy.yml
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
name: Build and Deploy to Cloud Run
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Log in to Google Cloud
|
||||
uses: google-github-actions/auth@v1
|
||||
with:
|
||||
credentials_json: ${{ secrets.GCP_SA_KEY }}
|
||||
|
||||
- name: Configure Docker for Google Cloud
|
||||
run: gcloud auth configure-docker
|
||||
|
||||
- name: Build Docker image
|
||||
run: docker build -t gcr.io/${{ secrets.GCP_PROJECT_ID }}/moneyprinterturbo:$GITHUB_SHA .
|
||||
|
||||
- name: Push Docker image
|
||||
run: docker push gcr.io/${{ secrets.GCP_PROJECT_ID }}/moneyprinterturbo:$GITHUB_SHA
|
||||
|
||||
- name: Deploy to Cloud Run
|
||||
run: |
|
||||
gcloud run deploy moneyprinterturbo \
|
||||
--image gcr.io/${{ secrets.GCP_PROJECT_ID }}/moneyprinterturbo:$GITHUB_SHA \
|
||||
--platform managed \
|
||||
--region ${{ secrets.GCP_REGION }} \
|
||||
--allow-unauthenticated
|
||||
Loading…
Reference in New Issue
Block a user