Skip to content

Commit 5af77ed

Browse files
authored
Create publish-backend.yml
1 parent bf8bc6d commit 5af77ed

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish .NET Backend to GHCR
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
jobs:
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Log in to GitHub Container Registry
21+
uses: docker/login-action@v3
22+
with:
23+
registry: ghcr.io
24+
username: dlopes-se
25+
password: ${{ secrets.GHCR_PAT }}
26+
27+
- name: Build and push backend image
28+
uses: docker/build-push-action@v5
29+
with:
30+
context: ./src
31+
file: ./src/Dockerfile
32+
push: true
33+
tags: |
34+
ghcr.io/dlopes-se/dotnet-qrshop:latest
35+
ghcr.io/dlopes-se/dotnet-qrshop:${{ github.sha }}

0 commit comments

Comments
 (0)