Skip to content

Update actions/setup-dotnet digest to 67a3573 #47

Update actions/setup-dotnet digest to 67a3573

Update actions/setup-dotnet digest to 67a3573 #47

Workflow file for this run

name: CI
on:
push:
branches:
- main
- renovate/*
paths-ignore:
- README.md
- AGENTS.md
- docs/**
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
image_sha: ${{ steps.push_image.outputs.image_sha }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Setup .NET
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
with:
dotnet-version: 10.0.x
- name: Setup Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: OpenVoting.Client/package-lock.json
- name: Restore backend dependencies
run: dotnet restore OpenVoting.slnx
- name: Build backend
run: dotnet build OpenVoting.slnx --configuration Release --no-restore
- name: Test backend
run: dotnet test OpenVoting.slnx --configuration Release --no-build
- name: Restore frontend dependencies
run: npm ci
working-directory: OpenVoting.Client
- name: Build frontend
run: npm run build
working-directory: OpenVoting.Client
- name: Test frontend
run: npm run test
working-directory: OpenVoting.Client
- name: Build Docker images
run: |
app="openvoting"
echo "Building $app"
docker build -t $app -f "OpenVoting.Server/Dockerfile" .
- name: Push Docker images
id: push_image
run: |
echo $GITHUB_TOKEN | docker login ghcr.io --username AmyJeanes --password-stdin
app="openvoting"
echo "Pushing $app"
docker tag $app ghcr.io/amyjeanes/openvoting/$app:latest
docker push ghcr.io/amyjeanes/openvoting/$app:latest
# Get the image SHA and set it as output
IMAGE_SHA=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/amyjeanes/openvoting/$app:latest | cut -d'@' -f2)
echo "image_sha=$IMAGE_SHA" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.ref == 'refs/heads/main'
terraform:
if: github.ref == 'refs/heads/main'
needs: build
name: Terraform
uses: ./.github/workflows/terraform.yaml
with:
runApply: true
secrets: inherit
deploy:
if: github.ref == 'refs/heads/main'
needs: [build, terraform]
name: Deploy
uses: ./.github/workflows/deploy.yaml
with:
image_sha: ${{ needs.build.outputs.image_sha }}
secrets: inherit