Skip to content

Commit 02901ab

Browse files
committed
🚀 add package publishing
1 parent f9fe1ae commit 02901ab

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build and Publish Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
steps:
17+
- name: Setup lowercase name
18+
run: |
19+
echo "repository_owner_lowercased=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
20+
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Log in to GitHub Container Registry
25+
uses: docker/login-action@v3
26+
with:
27+
registry: ghcr.io
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Build Docker image
32+
run: |
33+
docker build -t ghcr.io/${{ env.repository_owner_lowercased }}/service_auth:latest .
34+
35+
- name: Push Docker image
36+
run: |
37+
docker push ghcr.io/${{ env.repository_owner_lowercased }}/service_auth:latest

0 commit comments

Comments
 (0)