Skip to content

Commit a4d70c2

Browse files
authored
workflow to build and publish docker image (#165)
* workflow to build and publish docker image * remove output
1 parent 360c770 commit a4d70c2

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Docker Build and Publish
2+
on:
3+
workflow_dispatch:
4+
5+
env:
6+
REGISTRY: ghcr.io
7+
IMAGE_NAME: ${{ github.repository }}
8+
9+
permissions:
10+
contents: write
11+
packages: write
12+
13+
jobs:
14+
build:
15+
if: ${{ github.actor != 'dependabot'}}
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
21+
- name: Log in to the Container registry
22+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
23+
with:
24+
registry: ${{ env.REGISTRY }}
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
- name: Push Docker Image
28+
if: ${{ success() }}
29+
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355
30+
with:
31+
context: .
32+
file: ./Dockerfile
33+
push: true
34+
tags: |
35+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:main
36+
platforms: linux/amd64
37+
provenance: false
38+
sbom: false

0 commit comments

Comments
 (0)