fix: attach token when requesting appflowy image/file

This commit is contained in:
Nathan
2025-11-16 09:39:15 +08:00
parent 8de485d60a
commit 874fb319fe
8 changed files with 184 additions and 16 deletions

View File

@@ -27,6 +27,11 @@ on:
type: boolean
required: false
default: true
test:
description: 'If true, append _test to tag and skip latest tag'
type: boolean
required: false
default: false
env:
LATEST_TAG: latest
@@ -65,6 +70,9 @@ jobs:
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
T="${{ github.event.inputs.tag_name }}"
if [ "${{ github.event.inputs.test }}" == "true" ]; then
T="${T}_test"
fi
else
# Extract tag from ref (e.g., refs/tags/v1.2.3 -> v1.2.3)
T="${GITHUB_REF#refs/tags/}"
@@ -89,7 +97,7 @@ jobs:
cache-to: type=gha,mode=max,scope=appflowy_web-${{ matrix.job.arch }}
tags: |
${{ env.IMAGE_NAME }}:${{ env.GIT_TAG }}-${{ matrix.job.arch }}
${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_latest == 'true') || github.event_name == 'push' && format('{0}:{1}-{2}', env.IMAGE_NAME, env.LATEST_TAG, matrix.job.arch) || '' }}
${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_latest == 'true' && github.event.inputs.test != 'true') || (github.event_name == 'push' && format('{0}:{1}-{2}', env.IMAGE_NAME, env.LATEST_TAG, matrix.job.arch)) || '' }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
build-args: |
@@ -114,6 +122,9 @@ jobs:
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
T="${{ github.event.inputs.tag_name }}"
if [ "${{ github.event.inputs.test }}" == "true" ]; then
T="${T}_test"
fi
else
# Extract tag from ref (e.g., refs/tags/v1.2.3 -> v1.2.3)
T="${GITHUB_REF#refs/tags/}"
@@ -129,7 +140,7 @@ jobs:
push: true
- name: Create and push manifest for appflowy_web:latest
if: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_latest == 'true') || github.event_name == 'push' }}
if: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_latest == 'true' && github.event.inputs.test != 'true') || (github.event_name == 'push') }}
uses: Noelware/docker-manifest-action@0.4.3
with:
inputs: ${{ secrets.DOCKER_HUB_USERNAME }}/appflowy_web:${{ env.LATEST_TAG }}