Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit c6c5ad5

Browse files
committed
Create a Docker Image per commit
1 parent 1845e33 commit c6c5ad5

2 files changed

Lines changed: 25 additions & 28 deletions

File tree

.github/workflows/build-commit.yml

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
1+
name: Publish Docker Image
12
on:
23
push:
34
branches:
4-
- main
5-
paths:
6-
- ".github/workflows/build-commit.yml"
7-
- "src/**"
8-
- "NotifierRedirecter.sln"
9-
- "Dockerfile"
10-
11-
env:
12-
DOTNET_NOLOGO: 1
13-
DOTNET_CLI_TELEMETRY_OPTOUT: 1
14-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
15-
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
5+
- master
6+
workflow_dispatch:
167

178
jobs:
189
build-commit:
19-
name: "Build Commit ${{ github.sha }}"
10+
name: Build Commit
2011
runs-on: ubuntu-latest
21-
if: "!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[ci-skip]')"
2212
steps:
2313
- name: Checkout
2414
uses: actions/checkout@v3
25-
- name: Setup .NET
26-
uses: actions/setup-dotnet@v3
15+
- name: Generate Date Tag
16+
run: echo "TAG=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
17+
- name: Set up QEMU
18+
uses: docker/setup-qemu-action@v1
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v1
21+
- name: Login to DockerHub
22+
uses: docker/login-action@v1
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.repository_owner }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
- name: Build and Push
28+
uses: docker/build-push-action@v2
2729
with:
28-
dotnet-version: 8
29-
- name: Build Project
30-
run: "dotnet build"
31-
- name: Build Dockerfile
32-
run: "docker build -t notifier-redirecter:latest ."
30+
context: .
31+
file: ./Dockerfile
32+
push: true
33+
build-args: VERSION=${{ env.TAG }}
34+
tags: |
35+
ghcr.io/kuylar/dspassistant:latest
36+
ghcr.io/kuylar/dspassistant:${{ env.TAG }}

.github/workflows/publish.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,11 @@ on:
33
push:
44
branches:
55
- master
6-
workflow_dispatch:
7-
inputs:
8-
tag:
9-
description: 'Tag'
10-
required: true
11-
default: 'latest'
126

137
jobs:
148
push-to-registery:
159
name: Publish Docker Image
1610
runs-on: ubuntu-latest
17-
if: "!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[ci-skip]')"
1811
steps:
1912
- name: Checkout
2013
uses: actions/checkout@v3

0 commit comments

Comments
 (0)