diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd538a5..3d84325 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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 "action@github.com" - git config --local user.name "GitHub Action" - git commit -m 'deploy' - - name: Force push to destination branch - uses: ad-m/github-push-action@v0.5.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: gh-pages - force: true - directory: ./api/MyApp/wwwroot diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a4e1f99..1002fe5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 "action@github.com" + git config --local user.name "GitHub Action" + git commit -m 'deploy' + - name: Force push to destination branch + uses: ad-m/github-push-action@v0.5.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: gh-pages + force: true + directory: ./api/MyApp/wwwroot deploy_via_ssh: needs: push_to_registry diff --git a/Dockerfile b/Dockerfile index 99773ea..472ffa7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"]