-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.52 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: "Automated release"
on:
push:
tags:
- "v*"
jobs:
publish-docker:
name: "Build and publish Docker image on ghcr.io"
runs-on: ubuntu-latest
steps:
- name: "⬇️ Checkout repository"
uses: actions/checkout@v2
- name: "❓ Find the release semantic version"
id: semver
uses: Steffo99/[email protected]
with:
string: ${{ github.ref_name }}
- name: "🔨 Setup Buildx"
uses: docker/setup-buildx-action@v2
- name: "🔑 Login to GitHub Containers"
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "🔽 Find the lowercase name of the repository"
id: reponame
uses: ASzc/change-string-case-action@v2
with:
string: ${{ github.repository }}
- name: "🏗 Build and push the Docker image"
uses: docker/build-push-action@v3
with:
target: "entrypoint"
tags: >-
ghcr.io/${{ steps.reponame.outputs.lowercase }}:${{ steps.semver.outputs.precedence }},
ghcr.io/${{ steps.reponame.outputs.lowercase }}:${{ steps.semver.outputs.core }},
ghcr.io/${{ steps.reponame.outputs.lowercase }}:${{ steps.semver.outputs.pair }},
ghcr.io/${{ steps.reponame.outputs.lowercase }}:${{ steps.semver.outputs.major }},
ghcr.io/${{ steps.reponame.outputs.lowercase }}:latest
push: true