File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424 if : ${{ github.event.workflow_run.conclusion == 'success' }}
2525 steps :
2626 - name : Checkout code
27- uses : actions/checkout@v3
27+ uses : actions/checkout@v4
2828
2929 - name : Set up environment variables
3030 run : |
@@ -87,10 +87,27 @@ jobs:
8787 password : ${{ env.KAMAL_REGISTRY_PASSWORD }}
8888
8989 - name : Setup .NET
90- uses : actions/setup-dotnet@v3
90+ uses : actions/setup-dotnet@v4
9191 with :
9292 dotnet-version : ' 8.0'
9393
94+ - name : Set up Docker Buildx
95+ uses : docker/setup-buildx-action@v3
96+
97+ # Build custom base image first
98+ - name : Build custom base image
99+ run : |
100+ cat << 'EOF' > base.Dockerfile
101+ FROM mcr.microsoft.com/dotnet/aspnet:8.0
102+ RUN apt-get update && apt-get install -y curl unzip \
103+ && curl -fsSL https://bun.sh/install | bash \
104+ && mv /root/.bun/bin/bun /usr/local/bin/ \
105+ && apt-get clean \
106+ && rm -rf /var/lib/apt/lists/*
107+ EOF
108+
109+ docker build -f base.Dockerfile -t dotnet-bun-base .
110+
94111 - name : Build and push Docker image
95112 run : |
96- dotnet publish --os linux --arch x64 -c Release -p:ContainerRepository=${{ env.image_repository_name }} -p:ContainerRegistry=ghcr.io -p:ContainerImageTags=latest -p:ContainerPort=80
113+ dotnet publish --os linux --arch x64 -c Release /p:ContainerBaseImage=dotnet-bun-base -p:ContainerRepository=${{ env.image_repository_name }} -p:ContainerRegistry=ghcr.io -p:ContainerImageTags=latest -p:ContainerPort=80
You can’t perform that action at this time.
0 commit comments