This repository contains reusable GitHub Actions workflows designed to simplify CI/CD pipelines.
A reusable workflow to build and publish a .NET application for multiple architectures and push the resulting Docker image to GHCR.
Call this workflow from another workflow file (e.g., .github/workflows/build.yml) like so:
name: Build .NET Application
on:
workflow_dispatch:
jobs:
build:
uses: dashdevs/actions/.github/workflows/build-dotnet-app.yml@main
with:
amd64: true
arm64: true
project_path: "./src/MyProject"
dockerfile_path: "./Dockerfile"amd64(boolean, required): Build forlinux/amd64.arm64(boolean, required): Build forlinux/arm64.project_path(string, required): Path to the .NET project to publish.dockerfile_path(string, optional): Path to the Dockerfile (default isrelease.Dockerfile).
- Base images used in
FROMshould support all target platforms (e.g.,linux/amd64andlinux/arm64). - Avoid hardcoding architecture-specific instructions.
- Use environment variables like
${TARGETARCH}to differentiate build targets. - Ensure platform-specific binaries are correctly copied (e.g., from
publish/linux-${TARGETARCH}). - Test locally using BuildKit:
docker buildx build --platform linux/amd64,linux/arm64 .
ARG ASPNET_RUNTIME_IMAGE="mcr.microsoft.com/dotnet/aspnet:8.0-alpine"
FROM ${ASPNET_RUNTIME_IMAGE} AS release
ARG TARGETARCH
WORKDIR /app
COPY publish/linux-${TARGETARCH}/ ./
ENTRYPOINT ["./MyApp"]This Dockerfile uses a configurable base image and TARGETARCH to support multi-architecture builds.
A reusable workflow for uploading Django static files to AWS S3 using OIDC authentication.
Create a workflow file (e.g., .github/workflows/deploy.yml) with the following content:
name: Deploy Static Files
on:
push:
branches: [main]
jobs:
upload-static-files:
uses: dashdevs/actions/.github/workflows/upload-django-static-to-s3-oidc.yml@main
with:
python-version: '3.11'
role-to-assume: "arn:aws-cn:iam::123456789100:role/my-github-actions-role"
aws-region: "us-east-1"
source_dir: "./static/"
s3_bucket: "my-bucket-name/static"