@@ -11,14 +11,14 @@ jobs:
1111 publish :
1212 runs-on : ubuntu-latest
1313 steps :
14- - uses : actions/checkout@v2
14+ - uses : actions/checkout@v3
1515
1616 - name : Set up QEMU
17- uses : docker/setup-qemu-action@v1
17+ uses : docker/setup-qemu-action@v2
1818
1919 - name : Set up Docker Buildx
2020 id : buildx
21- uses : docker/setup-buildx-action@v1
21+ uses : docker/setup-buildx-action@v2
2222
2323 - name : Inspect builder
2424 run : |
@@ -28,22 +28,32 @@ jobs:
2828 echo "Flags: ${{ steps.buildx.outputs.flags }}"
2929 echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
3030
31- - name : Build the image
32- run : docker buildx build --output "type=image,push=false" --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x --tag mendhak/http-https-echo:latest --file ./Dockerfile .
33-
34- - name : Get the version
35- id : get_version
36- run : echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
37-
3831 - name : Log in to Docker Hub
39- uses : docker/login-action@v1
32+ uses : docker/login-action@v2
4033 with :
4134 username : ${{ secrets.DOCKER_HUB_USERNAME }}
4235 password : ${{ secrets.DOCKER_HUB_TOKEN }}
4336
44- - name : Push to Docker Hub
45- uses : docker/build-push-action@v2
37+ - name : Log in to GitHub Container registry
38+ uses : docker/login-action@v2
39+ with :
40+ registry : ghcr.io
41+ username : ${{ github.actor }}
42+ password : ${{ secrets.GITHUB_TOKEN }}
43+
44+ - name : Docker metadata
45+ id : meta
46+ uses : docker/metadata-action@v4
47+ with :
48+ images : |
49+ mendhak/http-https-echo
50+ ghcr.io/mendhak/http-https-echo
51+
52+ - name : Build and push image
53+ uses : docker/build-push-action@v4
4654 with :
55+ context : .
56+ platforms : linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
4757 push : true
48- tags : mendhak/http-https-echo: ${{ steps.get_version .outputs.VERSION }}
49- platforms : linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
58+ tags : ${{ steps.meta .outputs.tags }}
59+ labels : ${{ steps.meta.outputs.labels }}
0 commit comments