10
.github/workflows/docker-ghcr.yml
vendored
10
.github/workflows/docker-ghcr.yml
vendored
@@ -38,13 +38,19 @@ jobs:
|
|||||||
- name: Set version from input
|
- name: Set version from input
|
||||||
run: echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
|
run: echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Convert repository name to lowercase
|
||||||
|
run: |
|
||||||
|
# 将 github.repository 整体转换为小写
|
||||||
|
REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
|
||||||
|
echo "REPO_LOWER=$REPO_LOWER" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
run: |
|
run: |
|
||||||
cd ghproxy
|
cd ghproxy
|
||||||
docker buildx build --push \
|
docker buildx build --push \
|
||||||
--platform linux/amd64,linux/arm64 \
|
--platform linux/amd64,linux/arm64 \
|
||||||
--tag ghcr.io/${{ github.repository }}:${{ env.VERSION }} \
|
--tag ghcr.io/${{ env.REPO_LOWER }}:${{ env.VERSION }} \
|
||||||
--tag ghcr.io/${{ github.repository }}:latest \
|
--tag ghcr.io/${{ env.REPO_LOWER }}:latest \
|
||||||
--build-arg VERSION=${{ env.VERSION }} \
|
--build-arg VERSION=${{ env.VERSION }} \
|
||||||
-f Dockerfile .
|
-f Dockerfile .
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ var (
|
|||||||
regexp.MustCompile(`^(?:https?://)?huggingface\.co(?:/spaces)?/([^/]+)/(.+)$`),
|
regexp.MustCompile(`^(?:https?://)?huggingface\.co(?:/spaces)?/([^/]+)/(.+)$`),
|
||||||
regexp.MustCompile(`^(?:https?://)?cdn-lfs\.hf\.co(?:/spaces)?/([^/]+)/([^/]+)(?:/(.*))?$`),
|
regexp.MustCompile(`^(?:https?://)?cdn-lfs\.hf\.co(?:/spaces)?/([^/]+)/([^/]+)(?:/(.*))?$`),
|
||||||
regexp.MustCompile(`^(?:https?://)?download\.docker\.com/([^/]+)/.*\.(tgz|zip)$`),
|
regexp.MustCompile(`^(?:https?://)?download\.docker\.com/([^/]+)/.*\.(tgz|zip)$`),
|
||||||
|
regexp.MustCompile(`^(?:https?://)?(github|opengraph)\.githubassets\.com/([^/]+)/.+?$`),
|
||||||
}
|
}
|
||||||
httpClient *http.Client
|
httpClient *http.Client
|
||||||
config *Config
|
config *Config
|
||||||
|
|||||||
Reference in New Issue
Block a user