diff --git a/.github/workflows/list-img.yml b/.github/workflows/list-img.yml deleted file mode 100644 index 412ed14..0000000 --- a/.github/workflows/list-img.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: List Images in JSON -on: - push: - paths: - - "img/**" - - ".github/workflows/list-img.yml" - workflow_dispatch: -jobs: - convert: - runs-on: ubuntu-latest - steps: - - name: 檢出原始碼 - uses: actions/checkout@v2 - - - name: 設定 Node.js - uses: actions/setup-node@v2 - with: - node-version: "20.10.0" - - - name: 安裝套件 - run: | - sudo apt-get update - sudo apt-get install -y webp libheif-examples imagemagick - sudo apt-get install -y ffmpeg - - name: 列出 HEIC 文件 - run: find img -type f -name '*.HEIC' - - name: HEIC to JPG - run: | - find img -type f -name '*.HEIC' -exec sh -c ' - output_file="${1%.*}.jpg" - heif-convert "$1" "$output_file" - # 確保轉換成功後刪除原始 HEIC 文件 - if [ -f "$output_file" ]; then - rm "$1" - fi - ' _ {} \; - - name: 刪除多餘過渡檔案 #heif-convert 有時候會產生一些黑白的輔助圖片,這裡不希望被加進圖庫 - run: find . -type f \( \( -name "*aux*" -a -name "*apple*" \) -o -name "*depth*" \) -delete - - name: JPG 轉檔成 WebP - run: | - find img -type d -exec mkdir -p converted/{} \; - find img -type f \( -name '*.png' -o -name '*.jpg' -o -name '*.JPG' -o -name '*.jpeg' -o -name '*.JPEG' \) -exec sh -c ' - converted_file="converted/${1%.*}.webp" - echo "@!#$converted_file" - ffmpeg -i "$1" -q 50 "$converted_file" - ' _ {} \; - find converted -type f -name '*.webp' -exec sh -c 'convert "$1" -resize x1000 "$1"' _ {} \; - - name: 移動已轉換的社團圖片到 converted/club (已存在者除外) - run: | - mkdir -p converted/club - if [ -d converted/img/club ] && compgen -G "converted/img/club/*" > /dev/null; then - cp -rv --update=none converted/img/club/* converted/club/ - rm -rf converted/img/club/* - fi - - name: 列出圖片 - run: node ./list-img.js - - name: 提交變更 - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add . - if git diff --staged --quiet; then - echo "No changes" - else - git pull - git commit -m "🖼️更新圖片列表" - git push - fi - - \ No newline at end of file diff --git a/img/8.png b/img/8.png new file mode 100644 index 0000000..8ed2778 Binary files /dev/null and b/img/8.png differ