Fix poll api #56
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: Docker Image CI | |
on: | |
push: | |
branches: | |
- s16 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: development | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create config file | |
run: cp ultimate_pollbot_example.toml ultimate_pollbot.toml | |
- name: Update telegram.bot_name in config file | |
uses: colathro/toml-editor@1.1.1 | |
with: | |
file: "ultimate_pollbot.toml" | |
key: "telegram.bot_name" | |
value: ${{ vars.BOT_NAME }} | |
- name: Update telegram.api_key in config file | |
uses: colathro/toml-editor@1.1.1 | |
with: | |
file: "ultimate_pollbot.toml" | |
key: "telegram.api_key" | |
value: ${{ secrets.BOT_TOKEN }} | |
- name: Update telegram.admins in config file | |
uses: colathro/toml-editor@1.1.1 | |
with: | |
file: "ultimate_pollbot.toml" | |
key: "telegram.admins" | |
value: ${{ vars.BOT_ADMINS }} | |
- name: Update api.admin in config file | |
uses: colathro/toml-editor@1.1.1 | |
with: | |
file: "ultimate_pollbot.toml" | |
key: "api.admin" | |
value: ${{ vars.API_ADMIN }} | |
- name: Update api.seeders_chat_id in config file | |
uses: colathro/toml-editor@1.1.1 | |
with: | |
file: "ultimate_pollbot.toml" | |
key: "api.seeders_chat_id" | |
value: ${{ vars.SEEDERS_CHAT_ID }} | |
- name: Update database.sql_uri in config file | |
uses: colathro/toml-editor@1.1.1 | |
with: | |
file: "ultimate_pollbot.toml" | |
key: "database.sql_uri" | |
value: ${{ secrets.DB_URL }} | |
- name: Build and push bot | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: ghcr.io/beniamiiin/ultimate-poll-bot:bot | |
- name: Build and push api | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
file: api.Dockerfile | |
tags: ghcr.io/beniamiiin/ultimate-poll-bot:api |