Skip to content

Commit

Permalink
Rename job to 'qa' and update Dockerfile base images
Browse files Browse the repository at this point in the history
  • Loading branch information
urumo committed Oct 14, 2024
1 parent a834393 commit 4c3c327
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 31 deletions.
63 changes: 34 additions & 29 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,44 @@ on:
- 'src/Argon.Api/**'

jobs:
build:
# if: github.ref == 'refs/heads/master'
qa:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v1
with:
registry: ${{ secrets.REGISTRY }}
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PWD }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./src/Argon.Api/Dockerfile
push: true
tags: reg.staging.svck.dev/argon/api-orleans:${{ github.run_number }}
platforms: linux/arm64/v8
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: qa
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v1
with:
registry: ${{ secrets.REGISTRY }}
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PWD }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./src/Argon.Api/Dockerfile
push: true
tags: reg.staging.svck.dev/argon/api-orleans:${{ github.run_number }}
platforms: linux/arm64/v8
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

4 changes: 2 additions & 2 deletions src/Argon.Api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0-alpine3.18-arm64v8 AS base
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0-alpine-arm64v8 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine3.18-arm64v8 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine-arm64v8 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["src/Argon.Api/Argon.Api.csproj", "src/Argon.Api/"]
Expand Down

0 comments on commit 4c3c327

Please sign in to comment.