diff --git a/.gitea/workflows/main.yaml b/.gitea/workflows/main.yaml index 4c431f0..ee8a6fc 100644 --- a/.gitea/workflows/main.yaml +++ b/.gitea/workflows/main.yaml @@ -9,8 +9,9 @@ concurrency: 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 @@ -19,16 +20,21 @@ jobs: 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 @@ -49,11 +55,9 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Get Meta - id: meta + - name: Get Version + id: version run: | - echo REPO_OWNER=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $1}' ) >> $GITHUB_OUTPUT - echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT - name: Build and push @@ -66,5 +70,5 @@ jobs: linux/arm64 push: true tags: | - ${{ env.GITEA_INSTANCE_URL }}/${{ steps.meta.outputs.REPO_OWNER }}/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }} - ${{ env.GITEA_INSTANCE_URL }}/${{ steps.meta.outputs.REPO_OWNER }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }} \ No newline at end of file + ${{ 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 }} \ No newline at end of file