From 3e9277d7f5deb3207f6eebd61023fcc3b1904d01 Mon Sep 17 00:00:00 2001 From: Eric Matala de Mazza Date: Tue, 2 May 2023 03:58:41 +0200 Subject: [PATCH] feat: add automated deployment to google app engine --- .github/workflows/deploy-appengine.yaml | 36 +++++++++++++++++++++++++ README.md | 1 + app.yaml | 6 ----- 3 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/deploy-appengine.yaml diff --git a/.github/workflows/deploy-appengine.yaml b/.github/workflows/deploy-appengine.yaml new file mode 100644 index 0000000..e37a2b2 --- /dev/null +++ b/.github/workflows/deploy-appengine.yaml @@ -0,0 +1,36 @@ +name: deploy-appengine + +on: + push: + branches: + - main + +permissions: + contents: "read" + id-token: "write" + +jobs: + deploy-appengine: + runs-on: ubuntu-latest + steps: + - id: "checkout" + uses: "actions/checkout@v3" + + - id: "auth" + uses: "google-github-actions/auth@v1" + with: + workload_identity_provider: ${{ secrets.GCLOUD_WORKLOAD_IDENTITY_PROVIDER }} + service_account: ${{ secrets.GCLOUD_SERVICE_ACCOUNT }} + + - id: "deploy" + uses: "google-github-actions/deploy-appengine@v1" + with: + env_vars: |- + TELEGRAM_BOT_TOKEN=${{ secrets.TELEGRAM_BOT_TOKEN }} + DATABASE_URL=${{ secrets.DATABASE_URL }} + PASSWORD=${{ secrets.PASSWORD }} + APP_URL=${{ secrets.APP_URL }} + WEBHOOK_SECRET=${{ secrets.WEBHOOK_SECRET }} + + - id: "test" + run: 'curl "${{ steps.deploy.outputs.url }}"' diff --git a/README.md b/README.md index 20a8a75..b2105d5 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ ![GitHub last commit](https://img.shields.io/github/last-commit/ematala/putzbot) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/ematala/putzbot) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/ematala/putzbot) +[![deploy-appengine](https://github.com/ematala/putzbot/actions/workflows/deploy-appengine.yaml/badge.svg)](https://github.com/ematala/putzbot/actions/workflows/deploy-appengine.yaml) A Telegram bot to automate our shared flat. Users can send messages to the bot on telegram such as request their weekly duty, remind others or rotate to the next cycle. diff --git a/app.yaml b/app.yaml index f428f0a..28b5cb8 100644 --- a/app.yaml +++ b/app.yaml @@ -1,7 +1 @@ runtime: nodejs18 -env_variables: - TELEGRAM_BOT_TOKEN: "YOUR_TELEGRAM_BOT_TOKEN" - DATABASE_URL: "YOUR_DATABASE_URL" - PASSWORD: "YOUR_PASSWORD" - APP_URL: "YOUR_APP_URL" - WEBHOOK_SECRET: "YOUR_WEBHOOK_SECRET"