Skip to content

Commit 682e644

Browse files
committed
bump to .NET 7.0 + GHA fixes
- remove Microsoft.CodeAnalysis.FxCopAnalyzers - update GHA workflow; bump actions; no more sha1 tags - update nuget pkgs to 7.0+ - update Dockerfile to 7.0 - half-update to .NET 7.0
1 parent db2a271 commit 682e644

File tree

4 files changed

+503
-376
lines changed

4 files changed

+503
-376
lines changed

.github/workflows/master-latest.yml

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,54 +10,40 @@ jobs:
1010
steps:
1111

1212
- name: Checkout
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v3
1414

1515
- name: Set up QEMU
16-
uses: docker/setup-qemu-action@v1
16+
uses: docker/setup-qemu-action@v2
1717

1818
# We use buildx instead of regular build so we can take advantage of Docker layer cache via GithubActions' cache
1919
- name: Set up Docker Buildx
2020
id: buildx
21-
uses: docker/setup-buildx-action@v1
22-
23-
# Setup the Github Actions cache.
24-
- name: Cache Docker layers
25-
uses: actions/cache@v2
26-
with:
27-
path: /tmp/.buildx-cache
28-
key: ${{ runner.os }}-buildxarch-${{ github.sha }}
29-
restore-keys: |
30-
${{ runner.os }}-buildxarch-
21+
uses: docker/setup-buildx-action@v2
3122

3223
- name: Docker Login to GitHub Container Registry
33-
uses: docker/login-action@v1
24+
uses: docker/login-action@v2
3425
with:
3526
registry: ghcr.io
36-
username: ${{ github.repository_owner }} # github username or org
37-
password: ${{ secrets.GITHUB_TOKEN }} # github actions builtin token. repo has to have pkg access.
38-
39-
- name: Prepare
40-
id: prep
41-
run: |
42-
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
27+
username: ${{ github.repository_owner }} # GitHub username or org
28+
password: ${{ secrets.GITHUB_TOKEN }} # GitHub actions builtin token. repo has to have pkg access.
4329

4430
- name: Build and push
4531
id: docker_build
46-
uses: docker/build-push-action@v2
32+
uses: docker/build-push-action@v3
4733
with:
4834
context: .
4935
file: ./Dockerfile
5036
platforms: linux/amd64,linux/arm64
37+
pull: true
5138
push: true
52-
tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest,ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
39+
tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
5340
labels: |
5441
org.opencontainers.image.title=${{ github.event.repository.name }}
5542
org.opencontainers.image.description=${{ github.event.repository.description }}
5643
org.opencontainers.image.url=${{ github.event.repository.html_url }}
5744
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
58-
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
5945
org.opencontainers.image.revision=${{ github.sha }}
6046
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
61-
cache-from: type=local,src=/tmp/.buildx-cache/release
62-
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache/release
47+
cache-from: type=gha # all-automatic GitHub Actions caching
48+
cache-to: type=gha,mode=max
6349

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:impish as nodebuilder
1+
FROM ubuntu:rolling as nodebuilder
22
ENV DEBIAN_FRONTEND=noninteractive
33
RUN apt-get -y update
44
RUN apt-get -y install nodejs npm
@@ -8,7 +8,7 @@ RUN npm ci
88
COPY fluidsignalr/ClientApp/src /js/src
99
RUN npm run build
1010

11-
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
11+
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
1212
WORKDIR /app
1313

1414
# copy csproj and restore as distinct layers
@@ -28,7 +28,7 @@ RUN dotnet publish -c Release -o out
2828
###
2929
### Final runtime image
3030
###
31-
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS runtime
31+
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime
3232
WORKDIR /app
3333
COPY --from=build /app/fluidsignalr/out ./
3434
EXPOSE 5000

0 commit comments

Comments
 (0)