Skip to content

Commit 7fd54d5

Browse files
committed
feat: add pipeline to publish the docker image on release
1 parent 1b9c8ea commit 7fd54d5

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Publish Docker Image on Release
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
jobs:
13+
build-and-push:
14+
name: Build and Push Multi-Platform Docker Image
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout Code
19+
uses: actions/checkout@v3
20+
21+
- name: Log in to GitHub Container Registry
22+
uses: docker/login-action@v2
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v2
30+
with:
31+
install: true
32+
33+
- name: Set Lowercase Repository Info
34+
id: repo_info
35+
run: |
36+
echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
37+
echo "REPO_NAME=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
38+
39+
- name: Build and Push Multi-Platform Docker Image
40+
uses: docker/build-push-action@v5
41+
with:
42+
context: .
43+
push: true
44+
platforms: linux/amd64,linux/arm64
45+
tags: |
46+
ghcr.io/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}:latest
47+
ghcr.io/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}:${{ github.event.release.tag_name }}
48+
labels: |
49+
org.opencontainers.image.title=visionboard
50+
org.opencontainers.image.description=Transforming Data into Actionable Insights"
51+
org.opencontainers.image.url=https://github.com/OpenPathfinder/visionBoard
52+
org.opencontainers.image.source=https://github.com/OpenPathfinder/visionBoard.git
53+
org.opencontainers.image.version=${{ github.event.release.tag_name }}
54+
org.opencontainers.image.licenses=MIT
55+
maintainer="Ulises Gascón <[email protected]>"

0 commit comments

Comments
 (0)