Skip to content

Commit 5573fc9

Browse files
committed
chore(ci): build docker img & publish
1 parent ad31897 commit 5573fc9

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
release:
55
types: [published]
66

7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
711
jobs:
812
lint:
913
name: Lint
@@ -69,3 +73,29 @@ jobs:
6973
run: npm ci
7074
- name: Run coverage
7175
run: npm run cover
76+
build-and-push-image:
77+
runs-on: ubuntu-latest
78+
permissions:
79+
contents: read
80+
packages: write
81+
steps:
82+
- name: Checkout repository
83+
uses: actions/checkout@v3
84+
- name: Log in to the Container registry
85+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
86+
with:
87+
registry: ${{ env.REGISTRY }}
88+
username: ${{ github.actor }}
89+
password: ${{ secrets.GITHUB_TOKEN }}
90+
- name: Extract metadata (tags, labels) for Docker
91+
id: meta
92+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
93+
with:
94+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
95+
- name: Build and push Docker image
96+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
97+
with:
98+
context: .
99+
push: true
100+
tags: ${{ steps.meta.outputs.tags }}
101+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)