chore(deps): update docker/build-push-action action to v6.11.0
[ArchiSteamFarm.git] / .github / workflows / docker-publish-latest.yml
blob3da2fff82fb3b5693457763aeec048a658ac33c2
1 name: ASF-docker-publish-latest
3 on:
4   release:
5     types: [released]
7 env:
8   PLATFORMS: linux/amd64,linux/arm,linux/arm64
9   TAG: latest
11 permissions:
12   packages: write
14 jobs:
15   main:
16     environment: release-docker
17     runs-on: ubuntu-latest
19     steps:
20     - name: Checkout code
21       uses: actions/checkout@v4.2.2
22       with:
23         show-progress: false
24         submodules: recursive
26     - name: Set up Docker Buildx
27       uses: docker/setup-buildx-action@v3.8.0
29     - name: Login to ghcr.io
30       uses: docker/login-action@v3.3.0
31       with:
32         registry: ghcr.io
33         username: ${{ github.actor }}
34         password: ${{ secrets.GITHUB_TOKEN }}
36     - name: Login to DockerHub
37       uses: docker/login-action@v3.3.0
38       with:
39         username: ${{ secrets.DOCKERHUB_USERNAME }}
40         password: ${{ secrets.DOCKERHUB_TOKEN }}
42     - name: Prepare environment outputs
43       shell: sh
44       run: |
45         set -eu
47         echo "FIXED_TAG=$(echo ${{ github.ref }} | cut -d '/' -f 3)" >> "$GITHUB_ENV"
48         echo "DATE_ISO8601=$(date --iso-8601=seconds --utc)" >> "$GITHUB_ENV"
49         echo "GHCR_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
50         echo "DH_REPOSITORY=$(echo ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
52     - name: Build and publish Docker image from Dockerfile.Service
53       uses: docker/build-push-action@v6.11.0
54       with:
55         context: .
56         file: Dockerfile.Service
57         platforms: ${{ env.PLATFORMS }}
58         provenance: true
59         sbom: true
60         secrets: |
61           ASF_PRIVATE_SNK=${{ secrets.ASF_PRIVATE_SNK }}
62           STEAM_TOKEN_DUMPER_TOKEN=${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }}
63         labels: |
64           org.opencontainers.image.created=${{ env.DATE_ISO8601 }}
65           org.opencontainers.image.version=${{ env.FIXED_TAG }}
66           org.opencontainers.image.revision=${{ github.sha }}
67         tags: |
68           ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ env.TAG }}
69           ${{ env.DH_REPOSITORY }}:${{ env.TAG }}
70         push: true