Skip to content

Commit 8f9ffd6

Browse files
author
Dexter Duckworth
committed
ci: Added CI job to publish docker image
1 parent 0d790f1 commit 8f9ffd6

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish Docker Image
2+
3+
on:
4+
push:
5+
tags: ["*"]
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
11+
jobs:
12+
build-and-push-image:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
- name: Registry Login
22+
uses: docker/login-action@v2
23+
with:
24+
registry: ${{ env.REGISTRY }}
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
- name: Extract Metadata
28+
id: meta
29+
uses: docker/metadata-action@v4
30+
with:
31+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
32+
- name: Build and Push
33+
uses: docker/build-push-action@v3
34+
with:
35+
push: true
36+
context: .
37+
file: ./docker/Dockerfile.alpine
38+
tags: ${{ steps.meta.outputs.tags }}
39+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)