docs(footer): link authors to personal websites (#452) #684
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Web | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
| # SENTRY_LOG_LEVEL: "debug" | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| branches: | |
| - main | |
| paths: | |
| - 'src/NuGetTrends.Web/**' | |
| - 'src/NuGetTrends.Web.Client/**' | |
| - 'src/NuGetTrends.Data/**' | |
| - 'src/Directory.Build.props' | |
| - '**/web-workflow.yml' | |
| pull_request: | |
| paths: | |
| - 'src/NuGetTrends.Web/**' | |
| - 'src/NuGetTrends.Web.Client/**' | |
| - 'src/NuGetTrends.Data/**' | |
| - 'src/Directory.Build.props' | |
| - '**/web-workflow.yml' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
| DOTNET_NOLOGO: 1 | |
| DOTNET_MULTILEVEL_LOOKUP: 1 | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Build | |
| run: dotnet build -c Release -p:SourceRevisionId=${GITHUB_SHA::8} | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| working-directory: src/NuGetTrends.Web/ | |
| - name: Compute image tags | |
| id: tags | |
| run: | | |
| if [[ "$GITHUB_REF" == refs/tags/v* ]]; then | |
| VERSION="${GITHUB_REF#refs/tags/}" | |
| MINOR="${VERSION%.*}" | |
| MAJOR="${MINOR%.*}" | |
| echo "tags=${VERSION};${MINOR};${MAJOR};latest" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "tags=main;sha-${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Login to DockerHub | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Create container image | |
| run: > | |
| dotnet publish --no-build -c Release | |
| /t:PublishContainer | |
| ${{ github.event_name == 'pull_request' && '-p:ContainerArchiveOutputPath=./container.tar.gz' || '-p:ContainerRegistry=docker.io' }} | |
| env: | |
| ContainerImageTags: ${{ steps.tags.outputs.tags }} | |
| working-directory: src/NuGetTrends.Web/ | |
| - name: Smoke test container | |
| if: github.event_name == 'pull_request' | |
| working-directory: src/NuGetTrends.Web/ | |
| run: | | |
| docker load -i container.tar.gz | |
| image="nugettrends/nugettrends.web:sha-${GITHUB_SHA::8}" | |
| docker image inspect "$image" > /dev/null | |
| entrypoint=$(docker inspect --format='{{json .Config.Entrypoint}}' "$image") | |
| echo "Container entrypoint: $entrypoint" | |
| if ! echo "$entrypoint" | grep -q '/App/NuGetTrends.Web.dll'; then | |
| echo "::error::Container entrypoint does not point to /App/NuGetTrends.Web.dll" | |
| exit 1 | |
| fi | |
| output=$(timeout 10s docker run --rm --pull=never "$image" 2>&1 || true) | |
| echo "$output" |