Skip to content

Add documentation links to readme #9

Add documentation links to readme

Add documentation links to readme #9

Workflow file for this run

name: Create and publish a Docker image
on:
push:
branches:
- 'main'
# - 'dev'
tags:
- 'v*'
jobs:
push_to_registries:
name: Push Docker image to multiple registries
runs-on: ubuntu-latest
# Sets the permissions granted to the GITHUB_TOKEN for the actions in this job.
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
# This is your Docker Hub username and password.
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Uses the docker/login-action action to log in to the Container registry registry using the account and password that will publish the packages.
# Once published, the packages are scoped to the account defined here.
- name: Log in to the GitHub Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# This step uses docker/metadata-action to extract tags and labels that will be applied to the specified image. https://github.com/docker/metadata-action
# The id "meta" allows the output of this step to be referenced in a subsequent step. The images value provides the base name for the tags and labels.
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: |
${{ github.repository }} # minituff/nautical-backup
ghcr.io/${{ github.repository }}
tags: |
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
# output 0.1.2
type=semver,pattern={{version}}
# output 0.1
type=semver,pattern={{major}}.{{minor}}
# disabled if major zero
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
# This step uses the docker/build-push-action action to build the image, based on your repository's Dockerfile.
# If the build succeeds, it pushes the image to GitHub Packages.
# It uses the context parameter to define the build's context as the set of files located in the specified path.
# For more information, see "Usage" in the README of the docker/build-push-action repository. https://github.com/docker/build-push-action#usage
# It uses the tags and labels parameters to tag and label the image with the output from the "meta" step.
- name: Build and push Docker images
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}