Skip to content

Deploy Google Cloud Email Function #21

Deploy Google Cloud Email Function

Deploy Google Cloud Email Function #21

Workflow file for this run

name: Deploy Google Cloud Email Function
on:
workflow_dispatch:
permissions:
contents: "read"
id-token: "write"
jobs:
Deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Authenticate with Google Cloud
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_GITHUB_SER_ACC_KEY }}
- name: Setup Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Deploy Email function
run: |
gcloud functions deploy emailSender \
--gen2 \
--region=europe-north1 \
--runtime=nodejs18 \
--source=${{ github.workspace }}/email_function \
--entry-point=sendEmail \
--trigger-http \
--project=${{ secrets.GCP_PROJECT_ID }} \
--set-env-vars SENDING_EMAIL=${{ secrets.SENDING_EMAIL }},SENDING_PASS=${{ secrets.SENDING_PASS }},RECEIVING_EMAIL=${{ secrets.RECEIVING_EMAIL }},DOMAIN_URL=${{ secrets.DOMAIN_URL }} \
--allow-unauthenticated