-
Notifications
You must be signed in to change notification settings - Fork 91
41 lines (39 loc) · 1.33 KB
/
build-and-push-to-ghcr.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
33
34
35
36
37
38
39
40
41
name: Build and push to GHCR
on:
push:
branches: [main]
pull_request:
env:
GHCR_URL: ghcr.io/coqui-ai/xtts-streaming-server
jobs:
build-and-push-to-ghcr:
runs-on: ubuntu-latest
steps:
- name: Set Release version
shell: bash
run: |
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
echo "RELEASE_VERSION=dev" >> $GITHUB_ENV
else
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
fi
export TAG=${GHCR_URL}:${{ env.RELEASE_VERSION }}-${{ github.sha }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: 'Login to GitHub Container Registry'
run: |
set -xe
docker login --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} ghcr.io
- name: Build and push
uses: docker/build-push-action@v5
with:
file: server/Dockerfile
push: true
cache-from: type=registry,ref=ghcr.io/coqui-ai/xtts-streaming-server:latest
cache-to: type=registry,ref=ghcr.io/coqui-ai/xtts-streaming-server:latest
tags: coqui-ai/xtts-streaming-server:latest, ${GHCR_URL}:${{ env.RELEASE_VERSION }}-${{ github.sha }}
#build-args: