Files
MauMau-Server/.gitea/workflows/main.yaml
DTieman 6a8b81d85a
Some checks failed
Build Mau & Deploy Mau / build (push) Successful in 1m14s
Build Mau & Deploy Mau / deploy (push) Failing after 25s
Change meta step
2024-04-14 11:15:47 +02:00

74 lines
2.0 KiB
YAML

name: Build Mau & Deploy Mau
on: [push, pull_request]
concurrency:
group: mau
cancel-in-progress: true
env:
DOTNET_INSTALL_DIR: "./.dotnet"
DOCKER_LATEST: nightly
REPO_OWNER: "mau-mau"
REPO_NAME: "server"
GITEA_INSTANCE_URL: "git.mau-mau.nl"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
deploy:
runs-on: ubuntu-latest
needs: build
if: gitea.ref == 'refs/heads/mauster'
steps:
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v2
with:
config-inline: |
[registry."${{ env.GITEA_INSTANCE_URL }}"]
http = true
insecure = true
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: ${{ env.GITEA_INSTANCE_URL }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get Version
id: version
run: |
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
platforms: |
linux/amd64
linux/arm64
push: true
tags: |
${{ env.GITEA_INSTANCE_URL }}/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}
${{ env.GITEA_INSTANCE_URL }}/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}:${{ env.DOCKER_LATEST }}