-
Notifications
You must be signed in to change notification settings - Fork 250
38 lines (35 loc) · 1.32 KB
/
docker-image.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: Docker Build
on:
# Manual trigger only
workflow_dispatch:
jobs:
swirl-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout the Code
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.SBS_DOCKER_USER }}
password: ${{ secrets.SBS_DOCKER_PAT }}
- name: Build and Push Swirl Docker Image
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
TAG_NAME=$([ "$BRANCH_NAME" = "main" ] && echo "latest" || echo "$BRANCH_NAME")
docker buildx use devBuilder || docker buildx create --name devBuilder --use
docker buildx build -t swirlai/swirl-search:$TAG_NAME --platform linux/amd64,linux/arm64 --push .
- name: Update the Docker Repo Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.SBS_DOCKER_USER }}
password: ${{ secrets.SBS_DOCKER_PAT }}
repository: swirlai/swirl-search
- name: Upload Log Files
if: always()
uses: actions/upload-artifact@v4
with:
name: log-files
path: |
logs/
/var/log/syslog*