Skip to content

Commit

Permalink
move publish to gh-pages to use same assets as Docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Nov 3, 2021
1 parent 4f75f81 commit 7334a81
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
17 changes: 1 addition & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install and build npm
run: |
npm install
npm run publish
npm run build
working-directory: ./ui
- name: Setup dotnet
uses: actions/setup-dotnet@v1
Expand All @@ -25,18 +25,3 @@ jobs:
run: dotnet build ./api
- name: Test
run: dotnet test ./api/MyApp.Tests
- name: Deploy to GitHub Pages
run: |
cd ./api/MyApp/wwwroot
git init
git add -A
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m 'deploy'
- name: Force push to destination branch
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
force: true
directory: ./api/MyApp/wwwroot
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ jobs:
context: .
push: true
tags: ghcr.io/${{ env.image_repository_name }}:${{ github.event.release.tag_name }}

- name: Deploy to GitHub Pages
run: |
cd ./api/MyApp/wwwroot
git init
git add -A
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m 'deploy'
- name: Force push to destination branch
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
force: true
directory: ./api/MyApp/wwwroot

deploy_via_ssh:
needs: push_to_registry
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS build
WORKDIR /app

COPY . .
COPY ./api .
RUN dotnet restore

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

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

0 comments on commit 7334a81

Please sign in to comment.