diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6c15c03f..002a9cb3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -33,6 +33,13 @@ jobs: with: 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' @@ -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 diff --git a/Dockerfile b/Dockerfile index e94a0d08..653d08fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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/