-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Elliot Blackburn
committed
May 17, 2024
1 parent
6c46a75
commit 99b4f3b
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Action to build container image and publish to | ||
# GitHub Container Registry (ghcr.io). This runs | ||
# only for pushes to the master branch such as a merge. | ||
|
||
name: Package and publish container image | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
publish: | ||
name: Package and publish container image | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
# SHA tag for every push to master | ||
# "edge" tag for every push to master | ||
# semver tag for every tag push matching semver | ||
# latest for the newest tag semver tag push | ||
- name: Generate docker image meta tags | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/bluehatbrit/mdpdf | ||
flavor: | | ||
latest=true | ||
tags: | | ||
type=sha,event=push,branch=$repo.default_branch,prefix= | ||
type=edge,event=push,branch=$repo.default_branch | ||
type=semver,pattern={{version}},prefix=v | ||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: bluehatbrit | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and publish | ||
id: docker_build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
|
||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |