Skip to content

Build and Deploy

Build and Deploy #33

Workflow file for this run

name: Build and Deploy
on:
release:
types: [ published ]
permissions:
contents: write
env:
build-output: sakura-publish
jobs:
sentry-release:
runs-on: ubuntu-latest
environment:
name: production
url: https://dragonfruit.network/
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_ORG: dragonfruit
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
with:
projects: sakura
ignore_missing: true
version: ${{ github.ref_name }}
linux-container:
runs-on: ubuntu-latest
needs:
- sentry-release
environment:
name: production
url: https://dragonfruit.network/
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create build output folder
run: mkdir ${{ env.build-output }}
- name: Restore NuGet Packages
run: dotnet restore
- name: Build Project
run: dotnet publish -c Release -o ${{ env.build-output }} -p:Version=${{ github.ref_name }} DragonFruit.Sakura.Host/DragonFruit.Sakura.Host.csproj
- id: meta
name: Create metadata
uses: docker/metadata-action@v4
with:
images: dragonfruitdotnet/website
tags: |
type=raw,value=latest
type=ref,event=tag
- name: Dockerise
uses: docker/build-push-action@v3
with:
push: true
context: ${{ env.build-output }}
platforms: linux/arm64,linux/amd64
tags: ${{ steps.meta.outputs.tags }}
file: DragonFruit.Sakura.Host/Dockerfile
windows-iis:
runs-on: windows-latest
needs:
- sentry-release
environment:
name: production
url: https://dragonfruit.network/
steps:
- uses: actions/checkout@v3
- name: Build Program
run: dotnet publish -c Release -p:Version=${{ github.ref_name }} -p:PublishProfile=Web.pubxml DragonFruit.Sakura.Host
- name: Archive Output
run: Compress-Archive -Path .\DragonFruit.Sakura.Host\bin\publish\* -DestinationPath Sakura-${{ github.ref_name }}.zip
- name: Upload Deploy Package
uses: softprops/action-gh-release@v1
with:
files: Sakura-${{ github.ref_name }}.zip