tachybase_todo/.gitea/workflows/build-docker-base.yaml

42 lines
1.3 KiB
YAML
Raw Normal View History

name: Build docker image base
on:
push:
tags:
- 'base-*'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ vars.DOCKERHUB_URL }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Extract and format tag name
id: extract_tag
run: echo version=`echo "${{ gitea.ref }}" | cut -d'/' -f3` >> "$GITHUB_OUTPUT"
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: docker/tachybase/Dockerfile.base
push: true
# not work now https://github.com/go-gitea/gitea/pull/29584 wait for gitea 1.23.0
# cache-from: type=gha
# cache-to: type=gha,mode=max
build-args: |
TACHYBASE_VERSION=${{ steps.extract_tag.outputs.version }}
NPM_REGISTRY=${{ vars.REGISTRY_URL }}
tags: |
${{ vars.DOCKERHUB_URL }}/tachybase/base:${{ steps.extract_tag.outputs.version }}
${{ vars.DOCKERHUB_URL }}/tachybase/base:latest