Skip to content

Build and Deploy

Build and Deploy #38

Workflow file for this run

name: Build and Deploy
on:
release:
types: [ published ]
env:
build-output: sakura-publish
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create Sentry Release
uses: getsentry/action-release@v1
env:
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
with:
environment: production
ignore_missing: true
ignore_empty: true
version: ${{ github.event.release.tag_name }}
docker-linux:
runs-on: ubuntu-latest
environment:
name: production
url: https://dragonfruit.network/
needs:
- create-release
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ${{ vars.DOCKER_REGISTRY }}
username: ${{ secrets.OCI_USERNAME }}
password: ${{ secrets.OCI_PASSWORD }}
- name: Install wasm-tools
run: sudo dotnet workload install wasm-tools
- name: Build
run: dotnet publish -c Release -p:UseAppHost=false -p:Version=${{ github.event.release.tag_name }} -o ${{ env.build-output }} DragonFruit.Sakura.Host/DragonFruit.Sakura.Host.csproj
- id: meta
name: Create metadata
uses: docker/metadata-action@v5
with:
images: ${{ vars.DOCKER_IMAGE }}
tags: |
type=raw,value=latest
type=ref,event=tag
- name: Image Build and Push
uses: docker/build-push-action@v6
with:
context: ${{ env.build-output }}
tags: ${{ vars.DOCKER_IMAGE }}
platforms: linux/arm64,linux/amd64
file: DragonFruit.Sakura.Host/Dockerfile
push: true
windows-iis:
runs-on: windows-latest
permissions:
contents: write
needs:
- create-release
environment:
name: production
url: https://dragonfruit.network/
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Build Program
run: dotnet publish -c Release -p:Version=${{ github.event.release.tag_name }} -p:PublishProfile=Web.pubxml DragonFruit.Sakura.Host
- name: Archive Output
run: Compress-Archive -Path .\DragonFruit.Sakura.Host\bin\publish\* -DestinationPath Sakura-${{ github.event.release.tag_name }}.zip
- name: Upload Deploy Package
uses: softprops/action-gh-release@v1
with:
files: Sakura-${{ github.event.release.tag_name }}.zip