All checks were successful
Build, Push and Redeploy Docker Image / build-and-push (push) Successful in 4m45s
49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
name: Build, Push and Redeploy Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
REGISTRY_HOST: git.byte-mate.ru
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up QEMU (for multi-arch, optional)
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Gitea Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY_HOST }}
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.GIT_PASSWORD }}
|
|
|
|
- name: Get short SHA
|
|
id: vars
|
|
run: echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
|
|
|
|
- name: Build and push
|
|
run: |
|
|
docker buildx build \
|
|
--no-cache \
|
|
--push \
|
|
--platform linux/amd64 \
|
|
--tag ${{ env.REGISTRY_HOST }}/drholy/ollama-docker:${{ env.sha_short }} \
|
|
--tag ${{ env.REGISTRY_HOST }}/drholy/ollama-docker:latest \
|
|
--push \
|
|
.
|
|
|
|
# - name: Redeploy stack in Portainer
|
|
# run: |
|
|
# curl -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}" |