runner-images icon indicating copy to clipboard operation
runner-images copied to clipboard

Update Publishing images to Docker Hub

Open noxidsoft opened this issue 9 months ago • 0 comments

Tool name

Docs

Tool license

Public

Add or update?

  • [ ] Add
  • [X] Update

Desired version

As per test case or later

Approximate size

No response

Brief description of tool

Example YAML from link needs updating: https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-docker-hub

Annotation from post successful action:

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a, docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7, docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

### URL for tool's homepage

https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-docker-hub

### Provide a basic test case to validate the tool's functionality.

```bash
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Publish Docker image

on:
  push:
    branches:
      - master

jobs:
  push_to_registry:
    name: Push Docker image to Docker Hub
    runs-on: ubuntu-latest
    permissions:
      packages: write
      contents: read
      attestations: write
      id-token: write
    steps:
      - name: Check out the repo
        uses: actions/checkout@v4

      - name: Log in to Docker Hub
        uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}

      - name: Extract metadata (tags, labels) for Docker
        id: meta
        uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
        with:
          images: rustynox/linode-deploy

      - name: Build and push Docker image
        id: push
        uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
        with:
          context: .
          file: ./Dockerfile
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}

Platforms where you need the tool

  • [ ] Azure DevOps
  • [X] GitHub Actions

Runner images where you need the tool

  • [ ] Ubuntu 20.04
  • [X] Ubuntu 22.04
  • [X] Ubuntu 24.04
  • [ ] macOS 11
  • [ ] macOS 12
  • [ ] macOS 13
  • [ ] macOS 13 Arm64
  • [ ] macOS 14
  • [ ] macOS 14 Arm64
  • [ ] Windows Server 2019
  • [ ] Windows Server 2022

Can this tool be installed during the build?

No response

Tool installation time in runtime

No response

Are you willing to submit a PR?

No response

noxidsoft avatar May 24 '24 01:05 noxidsoft