Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing status check actions #44

Merged
merged 3 commits into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ name: "CodeQL"
on:
push:
branches: [ "main" ]
paths:
- 'FunctionApp/**'
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
paths:
- 'FunctionApp/**'
schedule:
- cron: '29 3 * * 2'

Expand All @@ -19,7 +15,24 @@ env:
PACKAGE_DIRECTORY: 'FunctionApp'

jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
function-app: ${{ steps.filter.outputs.function-app }}
steps:
- name: filter
id: filter
uses: dorny/paths-filter@v2
with:
filters: |
function-app:
- 'FunctionApp/**'

analyze:
needs: changes
if: ${{ needs.changes.outputs.function-app == 'true' }}
name: Analyze
runs-on: windows-latest
timeout-minutes: 30
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/filter-changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Filter Changes"

on:
workflow_dispatch:
workflow_call:

jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
function-app: ${{ steps.filter.outputs.function-app }}
steps:
- name: filter
id: filter
uses: dorny/paths-filter@v2
with:
filters: |
function-app:
- 'FunctionApp/**'
36 changes: 12 additions & 24 deletions .github/workflows/main_restpdfformfiller(dev).yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,29 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Azure Function App Deployment

on:
push:
branches:
- main
paths:
- 'FunctionApp/**'
workflow_dispatch:

env:
AZURE_FUNCTIONAPP_NAME: restpdfformfiller # set this to your function app name on Azure
PACKAGE_DIRECTORY: 'FunctionApp' # set this to the directory which contains pom.xml file
JAVA_VERSION: '17' # set this to the java version to use

jobs:
build-and-deploy:
runs-on: windows-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v3
changes:
uses: ./.github/workflows/filter-changes.yml

- name: Setup Java Sdk ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v3
with:
distribution: 'microsoft'
java-version: ${{ env.JAVA_VERSION }}
cache: maven
build:
needs: changes
if: ${{ needs.changes.outputs.function-app == 'true' }}
uses: ./.github/workflows/maven.yml

- name: 'Restore Project Dependencies Using Mvn'
shell: pwsh
run: |
pushd './${{ env.PACKAGE_DIRECTORY }}'
mvn clean package
popd
deploy-and-submit-dependencies:
needs: build
if: ${{ success() }}
runs-on: windows-latest
steps:
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
Expand All @@ -50,4 +38,4 @@ jobs:
- name: Submit Dependency Snapshot
uses: advanced-security/maven-dependency-submission-action@v3
with:
directory: '${{ env.PACKAGE_DIRECTORY }}'
directory: '${{ env.PACKAGE_DIRECTORY }}'
10 changes: 7 additions & 3 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@ name: Java CI with Maven
on:
pull_request:
branches: [ main ]
paths:
- 'FunctionApp/**'
workflow_dispatch:
workflow_call:

env:
PACKAGE_DIRECTORY: 'FunctionApp' # set this to the directory which contains pom.xml file
JAVA_VERSION: '17' # set this to the java version to use

jobs:
changes:
uses: ./.github/workflows/filter-changes.yml

build:
needs: changes
if: ${{ needs.changes.outputs.function-app == 'true' }}
runs-on: windows-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Java Sdk ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v3
Expand Down