2024-05-08 19:09:43 +08:00
|
|
|
name: build release image
|
2024-04-19 23:02:27 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
2024-05-08 19:09:43 +08:00
|
|
|
- 'release-*'
|
2024-04-19 23:02:27 +08:00
|
|
|
|
2024-07-19 10:35:44 +08:00
|
|
|
env:
|
|
|
|
npm_config_registry: ${{ vars.REGISTRY_URL }}
|
|
|
|
|
2024-04-19 23:02:27 +08:00
|
|
|
jobs:
|
2024-05-08 19:09:43 +08:00
|
|
|
docker:
|
2024-04-19 23:02:27 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-05-08 19:09:43 +08:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
2024-07-19 10:35:44 +08:00
|
|
|
- name: Setup pnpm
|
|
|
|
uses: pnpm/action-setup@v4
|
|
|
|
with:
|
|
|
|
version: 8.15.5
|
|
|
|
- name: Setup Node.js
|
2024-04-19 23:02:27 +08:00
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
2024-07-19 10:35:44 +08:00
|
|
|
node-version: 20.12.0
|
2024-04-19 23:02:27 +08:00
|
|
|
registry-url: ${{ vars.REGISTRY_URL }}
|
|
|
|
cache: 'pnpm'
|
|
|
|
- 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
|
2024-05-08 19:09:43 +08:00
|
|
|
run: echo version=`echo "${{ gitea.ref }}" | cut -d'/' -f3` >> "$GITHUB_OUTPUT"
|
2024-04-19 23:02:27 +08:00
|
|
|
- name: Build and push
|
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
with:
|
|
|
|
context: .
|
2024-05-08 19:09:43 +08:00
|
|
|
file: docker/tachybase/Dockerfile
|
2024-04-19 23:02:27 +08:00
|
|
|
push: true
|
2024-05-08 19:09:43 +08:00
|
|
|
# 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
|
2024-04-19 23:02:27 +08:00
|
|
|
build-args: |
|
|
|
|
TACHYBASE_VERSION=${{ steps.extract_tag.outputs.version }}
|
|
|
|
NPM_REGISTRY=${{ vars.REGISTRY_URL }}
|
|
|
|
tags: |
|
2024-04-20 05:20:09 +08:00
|
|
|
${{ vars.DOCKERHUB_URL }}/tachybase/tachybase:${{ steps.extract_tag.outputs.version }}
|
|
|
|
${{ vars.DOCKERHUB_URL }}/tachybase/tachybase:latest
|