-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (76 loc) · 2.23 KB
/
deploy.yml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Deploy Functions
description: This workflow deploys the Google Cloud Functions
on:
workflow_dispatch:
jobs:
deploy:
name: Deploy Google Cloud Functions
runs-on: ubuntu-latest
environment: production
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: 'google-github-actions/[email protected]'
with:
project_id: ${{ secrets.CAPY_PROJECT_ID }}
workload_identity_provider: ${{ secrets.CAPY_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.CAPY_SERVICE_ACCOUNT }}
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 500.0.0'
- name: Run script file
run: |
chmod +x ./scripts/get_version.sh
chmod +x ./scripts/deploy_functions.sh
./scripts/deploy_functions.sh
env:
CAPY_PROJECT_ID: ${{ secrets.CAPY_PROJECT_ID }}
CAPY_SERVER_REGION: ${{ secrets.CAPY_SERVER_REGION }}
shell: bash
create-tag:
name: Create Tag
runs-on: ubuntu-latest
needs: deploy
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Git
run: |
git config --global user.name "capymind"
git config --global user.email "[email protected]"
- name: Run script file
run: |
chmod +x ./scripts/get_version.sh
chmod +x ./scripts/create_tag.sh
./scripts/create_tag.sh
shell: bash
bump-version:
name: Bump Patch Version
runs-on: ubuntu-latest
needs: create-tag
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run script file
run: |
chmod +x ./scripts/get_version.sh
chmod +x ./scripts/bump_version.sh
./scripts/bump_version.sh
shell: bash
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
branch: 'bump-patch-version'
delete-branch: true
commit-message: 'Bump patch version'
title: 'Bump patch version'
token: ${{ secrets.GITHUB_TOKEN }}