-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (35 loc) · 1.12 KB
/
docker-build.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
name: Run Docker Build
on:
push:
branches: [main]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Get branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Get branch tag
shell: bash
run: |
BRANCH_NAME="$( echo "${{ steps.extract_branch.outputs.branch }}" | sed "s/[^[:alnum:].-]/-/g" )"
echo "tag=$BRANCH_NAME" >> $GITHUB_OUTPUT
id: sanitize_branch
- name: Build container
run: |
docker build -f Dockerfile -t taleweave-ai .
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push container
run: |
docker tag taleweave-ai apextoaster/taleweave-ai:${{ steps.sanitize_branch.outputs.tag }}
docker push apextoaster/taleweave-ai:${{ steps.sanitize_branch.outputs.tag }}