Skip to content

Cleanup

Cleanup #116

Workflow file for this run

name: Deploy
on:
push:
branches:
- prod
jobs:
DeployNuget:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "9.0.x"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Install Node dependencies
working-directory: frontend
run: npm ci
- name: Build Vue frontend
working-directory: frontend
run: npm run build:prod
- name: Build the project
working-directory: backend/ResQueue/ResQueue
run: dotnet build --configuration Release
- name: Pack the NuGet package
working-directory: backend/ResQueue/ResQueue
run: dotnet pack --configuration Release
- name: Push the NuGet package
working-directory: backend/ResQueue/ResQueue
run: dotnet nuget push bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://nuget.org
DeployImage:
runs-on: ubuntu-latest
env:
ResQueueImageVersion: "1.0.11"
DockerRegistry: ghcr.io
DockerRepository: filipbekic01/resqueue
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "9.0.x"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Install Node dependencies
working-directory: frontend
run: npm ci
- name: Build Vue frontend
working-directory: frontend
run: npm run build:prod
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish x64 image
working-directory: backend/ResQueue/ResQueue.Standalone
run: dotnet publish --os linux --arch x64 /t:PublishContainer -p:ContainerImageTag=${ResQueueImageVersion}-x64 -p:ContainerRepository=${DockerRepository} -p:ContainerRegistry=${DockerRegistry}
- name: Publish arm64 image
working-directory: backend/ResQueue/ResQueue.Standalone
run: dotnet publish --os linux --arch arm64 /t:PublishContainer -p:ContainerImageTag=${ResQueueImageVersion}-arm64 -p:ContainerRepository=${DockerRepository} -p:ContainerRegistry=${DockerRegistry}
- name: Publish image manifest
run: |
set -e
docker manifest create "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}" "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}-x64" "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}-arm64"
docker manifest push "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}"
docker manifest create "${DockerRegistry}/${DockerRepository}:latest" "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}-x64" "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}-arm64"
docker manifest push "${DockerRegistry}/${DockerRepository}:latest"