-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (25 loc) · 1.03 KB
/
docker-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Publish Docker image to GitHub Container Registry
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Create .env file
run: |
echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> .env
echo "BOT_TOKEN=${{ secrets.BOT_TOKEN }}" >> .env
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build and push Docker image for backend
run: |
docker build -t ghcr.io/${{ github.repository }}/backend:prod -f ./apps/backend/Dockerfile .
docker push ghcr.io/${{ github.repository }}/backend:prod
- name: Build and push Docker image for telegram-bot
run: |
docker build -t ghcr.io/${{ github.repository }}/telegram-bot:prod -f ./apps/telegram-bot/Dockerfile .
docker push ghcr.io/${{ github.repository }}/telegram-bot:prod