Deploy Functions #129
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: '>= 506.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 }} |