Build and Deploy #36
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy | |
on: | |
release: | |
types: [ published ] | |
env: | |
build-output: sakura-publish | |
jobs: | |
sentry-release: | |
runs-on: ubuntu-latest | |
environment: | |
name: production | |
url: https://dragonfruit.network/ | |
steps: | |
- uses: actions/checkout@v4 | |
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 }} | |
docker-linux: | |
runs-on: ubuntu-latest | |
environment: | |
name: production | |
url: https://dragonfruit.network/ | |
needs: | |
- sentry-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: | |
- sentry-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 |