45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
name: Publish Docker image
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
|
|
jobs:
|
|
push_to_registry:
|
|
name: Push Docker image to GitHub Packages
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Check out the repo
|
|
uses: actions/checkout@v2
|
|
-
|
|
name: Docker meta
|
|
id: docker_meta
|
|
uses: crazy-max/ghaction-docker-meta@v1
|
|
with:
|
|
images: ghcr.io/camptocamp/cups_exporter
|
|
tag-semver: |
|
|
{{version}}
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
-
|
|
name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.PAT }}
|
|
-
|
|
name: Build and push
|
|
id: docker_build
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
push: true
|
|
tags: ${{ steps.docker_meta.outputs.tags }}
|
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
|
-
|
|
name: Image digest
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|