diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 00000000..6d04b11c --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,69 @@ +name: Example documentation + +on: + push: + branches: + - docs + +jobs: + # Build the documentation + build: + runs-on: windows-latest # Required by DocFX + steps: + - name: Checkout + uses: actions/checkout@v3 + # with: + # submodules: true + + - name: Dotnet Setup + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 7.x + + - name: Dotnet install + run: dotnet tool install -g docfx + + - name: Dotnet Update + run: dotnet tool update -g docfx + + # - name: Install DocFX + # run: choco install -y docfx --version=2.59.4 + + - name: Use README.md as index.md + run: cp README.md Documentation~/index.md + + - name: Build + run: docfx Documentation~/docfx.json + + # Upload the generated documentation + - name: Upload site artifact + uses: actions/upload-artifact@v4 + with: + name: _site + path: ./_site # Must equals the 'build.dest' value on your docfx.json + + # Deploy the generated documentation to the gh-pages branch + deploy: + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + # with: + # submodules: true + + # Download the generated documentation + - name: Download site artifact + uses: actions/download-artifact@v4 + with: + name: _site + path: ./_site + + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: gh-pages + publish_dir: ./_site + allow_empty_commit: true + cname: tmpeffects.luca3317.dev diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 664a7077..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: Test package - -on: - pull_request_target: - types: [opened, synchronize] - push: - -jobs: - checkPrivilege: - runs-on: ubuntu-latest - steps: - - name: Get User Permission - id: checkAccess - uses: actions-cool/check-user-permission@v2 - with: - require: write - username: ${{ github.triggering_actor }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Check User Permission - if: steps.checkAccess.outputs.require-result == 'false' - run: | - echo "${{ github.triggering_actor }} does not have permissions on this repo." - echo "Current permission level is ${{ steps.checkAccess.outputs.user-permission }}" - echo "Job originally triggered by ${{ github.actor }}" - exit 1 - - testAllModes: - name: Tests - runs-on: ubuntu-latest - needs: checkPrivilege - strategy: - fail-fast: false - matrix: - projectPath: - - Package - unityVersion: - - '2022.3.37f1' - testMode: - - playmode - - editmode - steps: - - uses: actions/checkout@v4 - with: - lfs: true - - uses: game-ci/unity-test-runner@v4 - id: tests - env: - UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} - UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} - UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} - with: - packageMode: true - projectPath: ${{ matrix.projectPath }} - unityVersion: ${{ matrix.unityVersion }} - testMode: ${{ matrix.testMode }} - artifactsPath: ${{ matrix.testMode }}-artifacts - githubToken: ${{ secrets.GITHUB_TOKEN }} - checkName: ${{ matrix.testMode }} Test Results - coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+my.assembly.*' - - uses: actions/upload-artifact@v3 - if: always() - with: - name: Test results for ${{ matrix.testMode }} - path: ${{ steps.tests.outputs.artifactsPath }} - - uses: actions/upload-artifact@v3 - if: always() - with: - name: Coverage results for ${{ matrix.testMode }} - path: ${{ steps.tests.outputs.coveragePath }}