github.com/btcsuite/btcd@v0.24.0/.github/workflows/dimagespub.yml (about)

     1  name: Docker images build and publish
     2  
     3  on:
     4    push:
     5      tags:
     6        - v*
     7    # Allows you to run this workflow manually from the Actions tab
     8    workflow_dispatch:
     9  
    10  env:
    11    REGISTRY: ghcr.io
    12    IMAGE_NAME: ${{ github.repository }}
    13    # Build for default OS, linux, and common CPU architectures
    14    # Reference https://github.com/docker/setup-buildx-action#quick-start
    15    TPLATFORMS: linux/amd64,linux/arm64,linux/arm,linux/386
    16  
    17  jobs:
    18    build-push:
    19      runs-on: ubuntu-latest
    20      permissions:
    21        contents: read
    22        packages: write
    23  
    24      steps:
    25        - name: Checkout repository
    26          uses: actions/checkout@v2
    27  
    28        - name: Docker Setup Buildx
    29          id: buildx
    30          uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25
    31  
    32        - name: Log in to the Container registry
    33          uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
    34          with:
    35            registry: ${{ env.REGISTRY }}
    36            username: ${{ github.actor }}
    37            password: ${{ secrets.GITHUB_TOKEN }}
    38  
    39        - name: Extract metadata (tags, labels) for Docker
    40          id: meta
    41          uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
    42          with:
    43            images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
    44         
    45        - name: Build and push Docker images
    46          uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
    47          with:
    48            file: .github/workflows/Dockerfile
    49            labels: ${{ steps.meta.outputs.labels }}
    50            platforms: ${{ env.TPLATFORMS }}
    51            push: true
    52            tags: ${{ steps.meta.outputs.tags }}