@@ -30,52 +30,58 @@ jobs:
3030 runs-on : ubuntu-latest
3131 steps :
3232 - uses : actions/checkout@v4
33- # - name: Inject slug/short variables
34- # uses: rlespinasse/github-slug-action@v4
35- # - name: Get current date
36- # id: date
37- # run: echo "today=$(date +'%Y%m%d-%H%M')" >> $GITHUB_OUTPUT
38- # - name: Set up QEMU
39- # uses: docker/setup-qemu-action@v3
40- # - name: Set up Docker Buildx
41- # uses: docker/setup-buildx-action@v3
42- # - name: Login to DockerHub
43- # uses: docker/login-action@v3
44- # with:
45- # username: ${{ env.DOCKERHUB_USERNAME }}
46- # password: ${{ secrets.DOCKERHUB_TOKEN }}
47- # - name: Login to the Ali Registry
48- # uses: docker/login-action@v3
49- # with:
50- # registry: ${{ env.ALIHUB_URL }}
51- # username: ${{ env.ALIHUB_USERNAME }}
52- # password: ${{ secrets.ALIHUB_TOKEN }}
33+ - name : Inject slug/short variables
34+ uses : rlespinasse/github-slug-action@v4
35+ - name : Get current date
36+ id : date
37+ run : echo "today=$(date +'%Y%m%d-%H%M')" >> $GITHUB_OUTPUT
38+ - name : Set up QEMU
39+ uses : docker/setup-qemu-action@v3
40+ - name : Set up Docker Buildx
41+ uses : docker/setup-buildx-action@v3
42+ - name : Login to DockerHub
43+ uses : docker/login-action@v3
44+ with :
45+ username : ${{ env.DOCKERHUB_USERNAME }}
46+ password : ${{ secrets.DOCKERHUB_TOKEN }}
47+ - name : Login to GitHub Container Registry
48+ uses : docker/login-action@v3
49+ with :
50+ registry : ghcr.io
51+ username : ${{ github.actor }}
52+ password : ${{ secrets.GITHUB_TOKEN }}
53+ # - name: Login to the Ali Registry
54+ # uses: docker/login-action@v3
55+ # with:
56+ # registry: ${{ env.ALIHUB_URL }}
57+ # username: ${{ env.ALIHUB_USERNAME }}
58+ # password: ${{ secrets.ALIHUB_TOKEN }}
5359
54- # - name: 设置go环境
55- # uses: actions/setup-go@v5
56- # with:
57- # go-version-file: "go.mod"
58- # cache-dependency-path: "go.sum"
59- # - name: 安装 UPX
60- # uses: crazy-max/ghaction-upx@v3
61- # with:
62- # install-only: true
63- # - run: go install github.com/authelia/gox@latest # setup gox
64- # - run: make gox-linux
60+ # - name: 设置go环境
61+ # uses: actions/setup-go@v5
62+ # with:
63+ # go-version-file: "go.mod"
64+ # cache-dependency-path: "go.sum"
65+ # - name: 安装 UPX
66+ # uses: crazy-max/ghaction-upx@v3
67+ # with:
68+ # install-only: true
69+ # - run: go install github.com/authelia/gox@latest # setup gox
70+ # - run: make gox-linux
6571
66- # - name: Build and push
67- # uses: docker/build-push-action@v6
68- # with:
69- # context: .
70- # file: ./Dockerfile
71- # push: ${{ github.event_name != 'pull_request' }}
72- # cache-from: type=registry,ref=${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_REPONAME }}:buildcache
73- # cache-to: type=registry,ref=${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_REPONAME }}:buildcache,mode=max
74- # platforms: linux/amd64,linux/arm64
75- # tags: |
76- # ${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_REPONAME }}:latest
77- # ${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_REPONAME }}:${{ env.GITHUB_REF_NAME }}
78- # ${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_REPONAME }}:${{ steps.date.outputs.today }}
79- # ${{ env.ALIHUB_URL }} /${{ env.ALIHUB_IMAGE_REPONAME }}/${{ env.IMAGE_REPONAME }}:latest
80- # ${{ env.ALIHUB_URL }} /${{ env.ALIHUB_IMAGE_REPONAME }}/${{ env.IMAGE_REPONAME }}:${{ env.GITHUB_REF_NAME }}
81- # ${{ env.ALIHUB_URL }} /${{ env.ALIHUB_IMAGE_REPONAME }}/${{ env.IMAGE_REPONAME }}:${{ steps.date.outputs.today }}
72+ - name : Build and push
73+ uses : docker/build-push-action@v6
74+ with :
75+ context : .
76+ file : ./Dockerfile
77+ push : ${{ github.event_name != 'pull_request' }}
78+ cache-from : type=registry,ref=${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_REPONAME }}:buildcache
79+ cache-to : type=registry,ref=${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_REPONAME }}:buildcache,mode=max
80+ platforms : linux/amd64,linux/arm64
81+ tags : |
82+ ${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_REPONAME }}:latest
83+ ${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_REPONAME }}:${{ env.GITHUB_REF_NAME }}
84+ ${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_REPONAME }}:${{ steps.date.outputs.today }}
85+ ghcr.io /${{ github.actor }}/${{ github.repository }}
86+ ghcr.io /${{ github.actor }}/${{ github.repository }}:${{ env.GITHUB_REF_NAME }}
87+ ghcr.io /${{ github.actor }}/${{ github.repository }}:${{ steps.date.outputs.today }}
0 commit comments