chore: temporarily override deploy.yml to rebuild 1.0.0 image without latest tag
Deploy Telegram Bot / build-and-push (push) Successful in 22s
Deploy Telegram Bot / build-and-push (push) Successful in 22s
This commit is contained in:
+47
-73
@@ -1,73 +1,47 @@
|
|||||||
name: Deploy Telegram Bot
|
name: Deploy Telegram Bot
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- fix-1.0.0-image
|
||||||
|
|
||||||
env:
|
env:
|
||||||
VERSION: 1.0.0
|
VERSION: 1.0.0
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# ЧАСТЬ 1: Собираем образы и кладем в Gitea (чтобы делиться с ребятами)
|
# ЧАСТЬ 1: Собираем образы и кладем в Gitea (чтобы делиться с ребятами)
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest # Замени на метку твоего раннера, если она другая
|
runs-on: ubuntu-latest # Замени на метку твоего раннера, если она другая
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Login to Gitea Container Registry
|
- name: Login to Gitea Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: git.codeanddice.ru # НАПРИМЕР: gitea.my-server.com
|
registry: git.codeanddice.ru # НАПРИМЕР: gitea.my-server.com
|
||||||
username: toutsu
|
username: toutsu
|
||||||
password: ${{ secrets.GIT_TOKEN }}
|
password: ${{ secrets.GIT_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push Bot
|
- name: Build and push Bot
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: src/GmRelay.Bot/Dockerfile
|
file: src/GmRelay.Bot/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
git.codeanddice.ru/toutsu/gmrelay-bot:latest
|
git.codeanddice.ru/toutsu/gmrelay-bot:${{ env.VERSION }}
|
||||||
git.codeanddice.ru/toutsu/gmrelay-bot:${{ env.VERSION }}
|
labels: |
|
||||||
labels: |
|
org.opencontainers.image.source=https://git.codeanddice.ru/${{ gitea.repository }}
|
||||||
org.opencontainers.image.source=https://git.codeanddice.ru/${{ gitea.repository }}
|
|
||||||
|
- name: Build and push Web
|
||||||
- name: Build and push Web
|
uses: docker/build-push-action@v5
|
||||||
uses: docker/build-push-action@v5
|
with:
|
||||||
with:
|
context: .
|
||||||
context: .
|
file: src/GmRelay.Web/Dockerfile
|
||||||
file: src/GmRelay.Web/Dockerfile
|
push: true
|
||||||
push: true
|
tags: |
|
||||||
tags: |
|
git.codeanddice.ru/toutsu/gmrelay-web:${{ env.VERSION }}
|
||||||
git.codeanddice.ru/toutsu/gmrelay-web:latest
|
labels: |
|
||||||
git.codeanddice.ru/toutsu/gmrelay-web:${{ env.VERSION }}
|
org.opencontainers.image.source=https://git.codeanddice.ru/${{ gitea.repository }}
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.source=https://git.codeanddice.ru/${{ gitea.repository }}
|
|
||||||
|
|
||||||
# ЧАСТЬ 2: Запускаем эти образы на самом сервере
|
|
||||||
deploy:
|
|
||||||
needs: build-and-push
|
|
||||||
runs-on: ubuntu-latest # Тот же локальный раннер
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Create .env file with secrets
|
|
||||||
run: |
|
|
||||||
echo "TELEGRAM_BOT_TOKEN=${{ secrets.TELEGRAM_BOT_TOKEN }}" > .env
|
|
||||||
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env
|
|
||||||
echo "TELEGRAM_BOT_USERNAME=${{ secrets.TELEGRAM_BOT_USERNAME }}" >> .env
|
|
||||||
|
|
||||||
- name: Deploy Containers
|
|
||||||
run: |
|
|
||||||
# Авторизуемся локальным докером в нашей Gitea
|
|
||||||
docker login git.codeanddice.ru/ -u toutsu -p ${{ secrets.GIT_TOKEN }}
|
|
||||||
|
|
||||||
# Pull гарантирует, что мы получили нужную версию.
|
|
||||||
docker compose pull bot web
|
|
||||||
|
|
||||||
# Запускаем! Флаг -d оставит их работать в фоне.
|
|
||||||
docker compose up -d
|
|
||||||
Reference in New Issue
Block a user