Skip to content

release-docker

release-docker #14

name: release-docker
on:
workflow_dispatch:
inputs:
version:
description: "release version/tag"
required: true
jobs:
build:
name: build
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- uses: actions/checkout@v4
with:
path: siyuan-note
- name: clone origin and apply patches
run: |
mkdir -p ${{ github.workspace }}/go
cd ${{ github.workspace }}/siyuan-note/
git clone --branch ${{ github.event.inputs.version }} --depth=1 https://github.com/siyuan-note/siyuan.git
cd siyuan
git apply ${{ github.workspace }}/siyuan-note/patches/siyuan/disable-update.patch
git apply ${{ github.workspace }}/siyuan-note/patches/siyuan/mock-vip-user.patch
git status
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PWD }}
- name: Build the Docker image
working-directory: ${{ github.workspace }}/siyuan-note/siyuan
run: |
docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8 -t ${{ env.DOCKER_HUB_USER }}/siyuan:latest -t ${{ env.DOCKER_HUB_USER }}/siyuan:v${{ github.event.inputs.version }} .
env:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}