docker.yml (1582B)
1 name: Publish Docker image 2 3 permissions: read-all 4 5 on: 6 # For initial testing and we can remove it later. 7 workflow_dispatch: 8 inputs: 9 tag: 10 description: 'Tag for the container image' 11 required: true 12 type: string 13 14 jobs: 15 docker-publish: 16 name: Publish Docker image 17 runs-on: ubuntu-24.04 18 permissions: 19 contents: read 20 packages: write 21 env: 22 REGISTRY: ghcr.io 23 IMAGE_NAME: ${{ github.repository }} 24 steps: 25 - name: Check out repository 26 uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 27 # Based on https://docs.github.com/en/actions/publishing-packages/publishing-docker-images. 28 - name: Log in to the Container registry 29 uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 30 with: 31 registry: ${{ env.REGISTRY }} 32 username: ${{ github.actor }} 33 password: ${{ secrets.GITHUB_TOKEN }} 34 - name: Extract metadata (tags, labels) for Docker 35 id: meta 36 uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0 37 with: 38 images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 39 tags: | 40 latest 41 type=raw,value=${{ inputs.tag }} 42 - name: Build and push the Docker image 43 uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 44 with: 45 context: ./tools/docker 46 push: true 47 tags: ${{ steps.meta.outputs.tags }} 48 labels: ${{ steps.meta.outputs.labels }}