mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
Chore: push image to github docker registry
This commit is contained in:
parent
83efe2ae57
commit
16ae107e70
14
.github/workflows/docker.yml
vendored
14
.github/workflows/docker.yml
vendored
|
@ -34,6 +34,13 @@ jobs:
|
|||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to Github Package
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: Dreamacro
|
||||
password: ${{ secrets.PACKAGE_TOKEN }}
|
||||
|
||||
- name: Build dev branch and push
|
||||
if: github.ref == 'refs/heads/dev'
|
||||
uses: docker/build-push-action@v2
|
||||
|
@ -41,7 +48,7 @@ jobs:
|
|||
context: .
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
push: true
|
||||
tags: 'dreamacro/clash:dev'
|
||||
tags: 'dreamacro/clash:dev,ghcr.io/dreamacro/clash:dev'
|
||||
|
||||
- name: Get all docker tags
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
|
@ -49,9 +56,12 @@ jobs:
|
|||
id: tags
|
||||
with:
|
||||
script: |
|
||||
const ref = `${context.payload.ref.replace(/\/?refs\/tags\//, '')}`
|
||||
const tags = [
|
||||
'dreamacro/clash:latest',
|
||||
`dreamacro/clash:${context.payload.ref.replace(/\/?refs\/tags\//, '')}`
|
||||
`dreamacro/clash:${ref}`,
|
||||
'ghcr.io/dreamacro/clash:latest',
|
||||
`ghcr.io/dreamacro/clash:${ref}`
|
||||
]
|
||||
return tags.join(',')
|
||||
result-encoding: string
|
||||
|
|
|
@ -10,6 +10,7 @@ RUN go mod download && \
|
|||
mv ./bin/clash-docker /clash
|
||||
|
||||
FROM alpine:latest
|
||||
LABEL org.opencontainers.image.source https://github.com/Dreamacro/clash
|
||||
|
||||
RUN apk add --no-cache ca-certificates
|
||||
COPY --from=builder /Country.mmdb /root/.config/clash/
|
||||
|
|
Loading…
Reference in New Issue
Block a user