Skip to content

fix action

fix action #12

name: 'Build and deploy app :)'
on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.100'
- name: build
uses: ./.github/actions/build-app/
with:
build-number: ${{github.run_number}}
- name: publish artifacts
run: dotnet publish --no-restore --no-build --configuration Release --output artifacts/backend src/devschool-ci-test.csproj
- name: Run unit tests
run: dotnet test
notify:
name: notifications
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- name: Checkout
uses: actions/checkout@v4
- name: notify
uses: ./.github/actions/notify-action/
if: needs.build.result == 'failure' || (needs.build.result == 'success' && github.ref == 'refs/heads/main')
env:
SLACK_USERNAME: GitHubAction
with:
build-result: ${{ needs.build.result }}
loop-webhook: ${{ secrets.LOOP_WEBHOOK }}
# - name: Login to GitHub container registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: selfdeceited
# password: ${{ secrets.GHCR_PUBLISH_TOKEN }}
# - name: Build and push image
# uses: docker/build-push-action@v5
# with:
# file: ./artifacts/backend/Dockerfile
# github-token: ${{ secrets.GHCR_PUBLISH_TOKEN }}
# push: true
# context: .
# tags: ghcr.io/selfdeceited/devschool-ci-test:${{ github.run_number }}-post
# build-args: |
# "GH_BUILD_NUMBER=${{ github.run_number }}"
# deploy:
# needs: [build]
# if: ${{ github.ref == 'refs/heads/main' }}
# uses: ./.github/workflows/deploy-app.yml
# with:
# image_number: ${{ github.run_number }}
# secrets: inherit