Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Yucked committed Oct 15, 2023
2 parents 3bb4b8a + 12fd638 commit 383034b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
40 changes: 37 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,49 @@

name: Build & Publish
on: push

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: 8.x

- name: Build Project
run: dotnet build --configuration Release -o Output

publish:
name: Publish to GitHub
runs-on: ubuntu-latest
needs: build

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Docker Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Normalize repository name
id: norm_name
run: |
echo IMAGE_NAME=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ env.IMAGE_NAME }}:latest
${{ env.IMAGE_NAME }}:${{ github.run_number }}
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0-preview-alpine
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine
RUN apk add --no-cache curl unzip

FROM build
RUN curl -OJL https://github.com/Yucked/Grimoire/archive/refs/heads/main.zip && \
unzip '*.zip' && \
mkdir app && mv Grimoire-main/* app/ && \
Expand All @@ -12,4 +11,4 @@ RUN dotnet restore && \
dotnet publish -c Release -o out

WORKDIR out
ENTRYPOINT ["dotnet", "Grimoire.Web.dll"]
ENTRYPOINT ["dotnet", "Grimoire.Web.dll"]

0 comments on commit 383034b

Please sign in to comment.