-
Notifications
You must be signed in to change notification settings - Fork 9
39 lines (36 loc) · 1.09 KB
/
api-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Publish API docker image to GitHub Container Registry
on:
push:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
upload:
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
run: dotnet publish --os linux --arch x64 /t:PublishContainer -c Release
working-directory: LiftLog.Api
- name: Tag image
run: docker tag liftlog-api:latest ghcr.io/liammorrow/liftlog:api
- name: Push image
run: docker push ghcr.io/liammorrow/liftlog:api