mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
chore(ci): github action push to docker hub
This commit is contained in:
@@ -8,9 +8,13 @@ on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
jobs:
|
||||
release:
|
||||
if: github.event_name == 'push'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -34,4 +38,48 @@ jobs:
|
||||
# - run: pnpm publish -r --access public
|
||||
# env:
|
||||
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||
# NPM_CONFIG_PROVENANCE: true
|
||||
# NPM_CONFIG_PROVENANCE: true
|
||||
|
||||
dockerhub:
|
||||
if: github.event_name == 'release'
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- image: server
|
||||
dockerfile: docker/Dockerfile.server
|
||||
- image: agent
|
||||
dockerfile: docker/Dockerfile.agent
|
||||
- image: web
|
||||
dockerfile: docker/Dockerfile.web
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set build time
|
||||
id: vars
|
||||
run: echo "build_time=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push multi-arch image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ${{ matrix.dockerfile }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: memohai/${{ matrix.image }}:${{ github.event.release.tag_name }}
|
||||
build-args: |
|
||||
VERSION=${{ github.event.release.tag_name }}
|
||||
COMMIT_HASH=${{ github.sha }}
|
||||
BUILD_TIME=${{ steps.vars.outputs.build_time }}
|
||||
Reference in New Issue
Block a user