2024-05-19 19:30:20 +00:00
|
|
|
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
|
2024-06-01 09:45:38 +00:00
|
|
|
- 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
|
2024-05-19 19:30:20 +00:00
|
|
|
- name: Build container
|
|
|
|
run: |
|
2024-06-01 09:45:38 +00:00
|
|
|
docker build -f Dockerfile -t taleweave-ai .
|
2024-05-19 19:30:20 +00:00
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Push container
|
|
|
|
run: |
|
2024-06-01 09:45:38 +00:00
|
|
|
docker tag taleweave-ai apextoaster/taleweave-ai:${{ steps.sanitize_branch.outputs.tag }}
|
|
|
|
docker push apextoaster/taleweave-ai:${{ steps.sanitize_branch.outputs.tag }}
|