-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (50 loc) · 1.41 KB
/
docker-image.yaml
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: 'Build Docker image'
on:
workflow_dispatch:
env:
TZ: America/Chicago
jobs:
docker_build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore
#
# Pre-build to catch any initial errors
- name: Build
run: |
dotnet publish \
--configuration Release \
-r linux-x64 \
-o built
#
#
- name: docker login
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
#
- name: docker build
run: |
docker build \
-t gh-action-plot \
--label "org.opencontainers.image.source=https://github.com/erichiller/gh-action-plot/" \
--label "org.opencontainers.image.description=Program image" \
--label "org.opencontainers.image.licenses=MIT" \
.
- name: list images
run: docker images
- name: Tag image
run: |
docker tag gh-action-plot ghcr.io/erichiller/gh-action-plot:latest
#
- name: Push docker image
run: |
docker push ghcr.io/erichiller/gh-action-plot:latest