-
-
Notifications
You must be signed in to change notification settings - Fork 46
67 lines (56 loc) · 1.75 KB
/
Copy pathdeploy.yml
File metadata and controls
67 lines (56 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Deploy
on:
push:
branches:
- main
jobs:
build-container:
runs-on: ubuntu-latest
outputs:
image: ${{ steps.build.outputs.image }}
steps:
- uses: actions/checkout@v6
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v3
with:
credentials_json: ${{ secrets.DEPLOYER_SERVICE_ACCOUNT }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v3
- name: Configure Docker for Google Cloud
run: gcloud auth configure-docker gcr.io
- name: Build Container Image
id: build
run: |
cd functions
IMAGE_TAG="gcr.io/home-assistant-mobile-apps/mobile-push:${{ github.sha }}"
gcloud builds submit --tag $IMAGE_TAG
echo "image=$IMAGE_TAG" >> $GITHUB_OUTPUT
deploy-cloud-run:
needs: build-container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v3
with:
credentials_json: ${{ secrets.DEPLOYER_SERVICE_ACCOUNT }}
- name: Deploy to Cloud Run
uses: google-github-actions/deploy-cloudrun@v3
with:
service: mobile-push
image: ${{ needs.build-container.outputs.image }}
region: us-central1
flags: |
--allow-unauthenticated
--vpc-connector=${{ secrets.VPC_CONNECTOR }}
deploy-hosting:
needs: deploy-cloud-run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Deploy to Firebase
uses: w9jds/firebase-action@v15.20.0
with:
args: deploy --only hosting
env:
GCP_SA_KEY: ${{ secrets.DEPLOYER_SERVICE_ACCOUNT }}