Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 25 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Publish

env:
DOTNET_VERSION: "10.0.x"
DOTNET_CACHE: "dotnet-cache-${{ github.sha }}"
FRONTEND_CACHE: "frontend-cache-${{ github.sha }}"
NUGET_OUTPUT: ./Artifacts/NuGet

on:
Expand Down Expand Up @@ -61,11 +59,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- uses: actions/cache@v3
with:
path: ./Source/AuthProxy/wwwroot
key: ${{ env.FRONTEND_CACHE }}

- name: Setup Node
uses: actions/setup-node@v4
with:
Expand All @@ -79,6 +72,16 @@ jobs:
working-directory: ./Source/Web
run: npm run build

# Hand the built frontend to the dotnet-publish job. Artifacts (unlike the Actions
# cache) are writable on pull_request-triggered runs, which this workflow is.
- name: Upload frontend output
uses: actions/upload-artifact@v4
with:
name: frontend-wwwroot
path: ./Source/AuthProxy/wwwroot
retention-days: 1
include-hidden-files: true

dotnet-publish:
if: needs.release.outputs.publish == 'true'
runs-on: ubuntu-latest
Expand All @@ -88,25 +91,29 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- uses: actions/cache@v3
- name: Download frontend output
uses: actions/download-artifact@v4
with:
name: frontend-wwwroot
path: ./Source/AuthProxy/wwwroot
key: ${{ env.FRONTEND_CACHE }}
fail-on-cache-miss: true

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- uses: actions/cache@v3
with:
path: ./Source/AuthProxy/out
key: ${{ env.DOTNET_CACHE }}

- name: Publish
run: dotnet publish Source/AuthProxy/AuthProxy.csproj -c Release -o Source/AuthProxy/out -p:Version=${{ needs.release.outputs.version }}

# Hand the published binaries to the publish-docker job.
- name: Upload published output
uses: actions/upload-artifact@v4
with:
name: dotnet-out
path: ./Source/AuthProxy/out
retention-days: 1
include-hidden-files: true

publish-docker:
if: needs.release.outputs.publish == 'true'
runs-on: ubuntu-latest
Expand All @@ -116,11 +123,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- uses: actions/cache@v3
- name: Download published output
uses: actions/download-artifact@v4
with:
name: dotnet-out
path: ./Source/AuthProxy/out
key: ${{ env.DOTNET_CACHE }}
fail-on-cache-miss: true

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down
Loading