diff --git a/.github/workflows/container-latest.yml b/.github/workflows/container-latest.yml index 9bc7235..f14b857 100644 --- a/.github/workflows/container-latest.yml +++ b/.github/workflows/container-latest.yml @@ -4,36 +4,38 @@ name: Build DayFlags.Server on: - push: - branches: [ "master" ] + push: + branches: ["master"] + +env: + REGISTRY: ghcr.io jobs: - build-server: + build-server: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + + - name: Restore DayFlags.Server dependencies + working-directory: DayFlags.Server + run: dotnet restore - runs-on: ubuntu-latest + - name: Build DayFlags.Server + run: dotnet publish -c Release --no-restore - steps: - - uses: actions/checkout@v3 - - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 8.0.x - - - name: Restore DayFlags.Server dependencies - working-directory: DayFlags.Server - run: dotnet restore - - - name: Build DayFlags.Server - run: dotnet publish -c Release --no-restore - - - name: Upload DayFlags.Server Artifacts - uses: actions/upload-artifact@v3.1.3 - with: - name: backend-artifacts - path: DayFlags.Server/bin/Release/net8.0/publish/ + - name: Upload DayFlags.Server Artifacts + uses: actions/upload-artifact@v3.1.3 + with: + name: backend-artifacts + path: DayFlags.Server/bin/Release/net8.0/publish/ - build-docker-image: + build-docker-image: runs-on: ubuntu-22.04 permissions: contents: read @@ -42,26 +44,26 @@ jobs: - build-server steps: - uses: actions/checkout@v4 - + - name: Download build artifacts uses: actions/download-artifact@v3.0.2 with: name: backend-artifacts path: build/ - + - name: Docker Login uses: docker/login-action@v3.0.0 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - + - name: Docker Metadata action id: docker_metadata uses: docker/metadata-action@v5.0.0 with: images: ${{ env.REGISTRY }}/${{ github.repository }}:master - + - name: Build and push Docker image uses: docker/build-push-action@v5.1.0 with: