release 0.10.1 #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build, package, and publish a container image to our supported | |
# image registries. We generate a number of tags in different scenarios. | |
# | |
# * Commit pushed on default branch: publish with semver and "latest" tags. | |
# * Tag on default branch pushed: publish with short commit sha and "edge" tags. | |
# | |
# We currently publish to dockerhub and ghcr. | |
name: Package and publish container image | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- "v*" | |
jobs: | |
publish: | |
name: Build and publish image | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Generate container image meta tags | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
statsd/statsd | |
ghcr.io/statsd/statsd | |
flavor: | | |
latest=true | |
tags: | | |
type=semver,pattern=v{{version}},event=tag | |
type=semver,pattern=v{{major.minor}},event=tag | |
type=semver,pattern=v{{major}},event=tag | |
type=edge,branch=$repo.default_branch,event=push | |
type=sha,branch=$repo.default_branch,event=push | |
- name: Setup buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub container registry | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- name: Build and publish image | |
id: docker_build | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
- name: Echo image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |