All checks were successful
Build and push container image / build-and-push (push) Successful in 6m0s
54 lines
1.6 KiB
YAML
54 lines
1.6 KiB
YAML
# =============================================================================
|
|
# Forgejo Actions workflow to build and push Docker image
|
|
# =============================================================================
|
|
# Triggered on push to main. Pushes :latest plus :$SHA tags; the SHA matches
|
|
# what the service reports at GET /version.
|
|
# -----------------------------------------------------------------------------
|
|
|
|
name: Build and push container image
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
env:
|
|
IMAGE: git.workaround.org/chaas/vector-search
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: docker
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Docker CLI
|
|
run: |
|
|
apt-get update -qq
|
|
apt-get install -y --no-install-recommends docker.io
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.workaround.org
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.FORGEJO_TOKEN }}
|
|
|
|
- name: Build and Push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
build-args: |
|
|
SOURCE_COMMIT=${{ github.sha }}
|
|
tags: |
|
|
${{ env.IMAGE }}:latest
|
|
${{ env.IMAGE }}:${{ github.sha }}
|
|
cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache
|
|
cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max
|