Skip to content

Commit 7334a81

Browse files
committed
move publish to gh-pages to use same assets as Docker container
1 parent 4f75f81 commit 7334a81

3 files changed

Lines changed: 20 additions & 19 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Install and build npm
1515
run: |
1616
npm install
17-
npm run publish
17+
npm run build
1818
working-directory: ./ui
1919
- name: Setup dotnet
2020
uses: actions/setup-dotnet@v1
@@ -25,18 +25,3 @@ jobs:
2525
run: dotnet build ./api
2626
- name: Test
2727
run: dotnet test ./api/MyApp.Tests
28-
- name: Deploy to GitHub Pages
29-
run: |
30-
cd ./api/MyApp/wwwroot
31-
git init
32-
git add -A
33-
git config --local user.email "action@github.com"
34-
git config --local user.name "GitHub Action"
35-
git commit -m 'deploy'
36-
- name: Force push to destination branch
37-
uses: ad-m/github-push-action@v0.5.0
38-
with:
39-
github_token: ${{ secrets.GITHUB_TOKEN }}
40-
branch: gh-pages
41-
force: true
42-
directory: ./api/MyApp/wwwroot

.github/workflows/release.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,22 @@ jobs:
3535
context: .
3636
push: true
3737
tags: ghcr.io/${{ env.image_repository_name }}:${{ github.event.release.tag_name }}
38+
39+
- name: Deploy to GitHub Pages
40+
run: |
41+
cd ./api/MyApp/wwwroot
42+
git init
43+
git add -A
44+
git config --local user.email "action@github.com"
45+
git config --local user.name "GitHub Action"
46+
git commit -m 'deploy'
47+
- name: Force push to destination branch
48+
uses: ad-m/github-push-action@v0.5.0
49+
with:
50+
github_token: ${{ secrets.GITHUB_TOKEN }}
51+
branch: gh-pages
52+
force: true
53+
directory: ./api/MyApp/wwwroot
3854

3955
deploy_via_ssh:
4056
needs: push_to_registry

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
1+
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS build
22
WORKDIR /app
33

4-
COPY . .
4+
COPY ./api .
55
RUN dotnet restore
66

77
WORKDIR /app/MyApp
88
RUN dotnet publish -c release -o /out --no-restore
99

10-
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS runtime
10+
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal AS runtime
1111
WORKDIR /app
1212
COPY --from=build /out .
1313
ENTRYPOINT ["dotnet", "MyApp.dll"]

0 commit comments

Comments
 (0)