2020 target : x86_64-pc-windows-msvc
2121
2222 steps :
23- - uses : actions/checkout@v2
23+ - uses : actions/checkout@v4
2424
2525 - uses : actions-rs/toolchain@v1
2626 with :
4545 with :
4646 repo_token : ${{ secrets.GITHUB_TOKEN }}
4747 file : target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
48- asset_name : ${{ matrix.asset_name }}
49- tag : ${{ github.ref }}
48+ asset_name : ${{ matrix.artifact_name }}
49+ tag : ${{ github.ref }}
50+
51+ docker :
52+ name : Build and Push Docker Image
53+ runs-on : ubuntu-latest
54+ permissions :
55+ contents : read
56+ packages : write
57+
58+ steps :
59+ - name : Checkout repository
60+ uses : actions/checkout@v4
61+
62+ - name : Log in to the Container registry
63+ uses : docker/login-action@v3
64+ with :
65+ registry : ghcr.io
66+ username : ${{ github.actor }}
67+ password : ${{ secrets.GITHUB_TOKEN }}
68+
69+ - name : Extract metadata (tags, labels)
70+ id : meta
71+ uses : docker/metadata-action@v5
72+ with :
73+ images : ghcr.io/${{ github.repository }}
74+ tags : |
75+ type=semver,pattern={{version}}
76+ type=raw,value=latest,enable=${{ github.ref == format('refs/tags/{0}', github.event.repository.default_branch) }}
77+ type=sha
78+
79+ - name : Build and push Docker image
80+ uses : docker/build-push-action@v5
81+ with :
82+ context : .
83+ push : true
84+ tags : ${{ id.meta.outputs.tags }}
85+ labels : ${{ id.meta.outputs.labels }}
0 commit comments