ci: fix docker tag conflict, remove unnecessary steps

Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
This commit is contained in:
Shengqi Chen 2025-09-24 14:29:59 +08:00
parent c0b139b1c0
commit 5a02b9b7a6
No known key found for this signature in database
GPG Key ID: 6EE389C0F18AF774
2 changed files with 6 additions and 27 deletions

View File

@ -15,27 +15,6 @@ jobs:
- ubuntu-24.04-arm - ubuntu-24.04-arm
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
-
name: Determine docker tag
id: docker_tag
env:
TAG_NAME: ${{ github.ref }}
run: |
case "${TAG_NAME}" in
refs/heads/master)
tag=latest
;;
refs/tags/*)
tag=${TAG_NAME#refs/tags/}
;;
refs/heads/*)
tag=branch-${TAG_NAME#refs/heads/}
;;
*)
tag="dummy"
;;
esac
echo "docker_tag=${tag}" | tee -a $GITHUB_OUTPUT
- -
name: Checkout name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v5
@ -110,13 +89,13 @@ jobs:
name: Upload Build Artifacts name: Upload Build Artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: site name: site-${{ matrix.os}}
path: _site path: _site
- -
name: Upload Build Artifacts name: Upload Build Artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: stats.html name: stats.html-${{ matrix.os}}
path: _stats.html path: _stats.html
- -
name: Build and push name: Build and push
@ -125,7 +104,7 @@ jobs:
context: . context: .
file: Dockerfile.build file: Dockerfile.build
push: ${{ github.event_name == 'push' }} push: ${{ github.event_name == 'push' }}
tags: tunathu/mirror-web:${{ steps.docker_tag.outputs.docker_tag }} tags: tunathu/mirror-web
cache-from: | cache-from: |
type=local,src=/tmp/.buildx-cache type=local,src=/tmp/.buildx-cache
type=local,src=/tmp/local-test-build-cache type=local,src=/tmp/local-test-build-cache

View File

@ -20,8 +20,8 @@ RUN \
mv node_modules ../ && \ mv node_modules ../ && \
rm -rf /data/* rm -rf /data/*
ENV LANG C.UTF-8 ENV LANG=C.UTF-8
ENV JEKYLL_ENV production ENV JEKYLL_ENV=production
ENV VITE_RUBY_VITE_BIN_PATH /node_modules/.bin/vite ENV VITE_RUBY_VITE_BIN_PATH=/node_modules/.bin/vite
CMD ["bundle", "exec", "jekyll", "build"] CMD ["bundle", "exec", "jekyll", "build"]