Skip to content

Merge pull request #124 from preparingforexams/renovate/python-telegr… #62

Merge pull request #124 from preparingforexams/renovate/python-telegr…

Merge pull request #124 from preparingforexams/renovate/python-telegr… #62

Workflow file for this run

name: Build/Publish docker image
on:
push:
branches:
- master
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- run: sed -i -e "s#__TAG__#${GITHUB_SHA}#g" values.yaml
- uses: BlindfoldedSurgery/[email protected]
with:
raw_command: lint
- uses: BlindfoldedSurgery/[email protected]
with:
raw_command: lint --strict
build_push_docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: sed -i -e "s/{{VERSION}}/${GITHUB_SHA}/g" telegram_bot/bot.py
- name: Build the tagged Docker image
run: docker build -t ghcr.io/preparingforexams/hhh-diff-bot:${GITHUB_SHA} .
- name: Push the tagged Docker image
run: docker push ghcr.io/preparingforexams/hhh-diff-bot:${GITHUB_SHA}
deploy:
name: "Publish to k8s"
runs-on: ubuntu-latest
needs: [lint, build_push_docker]
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- run: sed -i -e "s/__TELEGRAM_TOKEN__/${{ secrets.BOT_TOKEN }}/g" values.yaml
- run: sed -i -e "s/__BING_IMAGE_API_SEARCH_KEY__/${{ secrets.BING_IMAGE_API_SEARCH_KEY }}/g" values.yaml
- run: sed -i -e "s/__OPENAI_API_KEY__/${{ secrets.OPENAI_API_KEY }}/g" values.yaml
- run: sed -i -e "s/__TAG__/${GITHUB_SHA}/g" values.yaml
- name: install helm chart
uses: BlindfoldedSurgery/[email protected]
with:
subcommand: upgrade
ref: .
release_name: hhhdiffbot
namespace: telegram-bots
atomic: true
install: true
kubeconfig: ${{ secrets.KUBECONFIG_RAW }}