Azure Function #27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a basic workflow to help you get started with Actions | |
| name: Azure Function | |
| on: | |
| push: | |
| paths: | |
| - 'azure/**' | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| #runs-on: ubuntu-latest | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| dotnet-version: ['8.0.x'] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Setup .NET Core SDK ${{ matrix.dotnet-version }} | |
| uses: actions/setup-dotnet@v1.7.2 | |
| with: | |
| dotnet-version: ${{ matrix.dotnet-version }} | |
| - name: Create artifacts folder | |
| run: | | |
| mkdir "$GITHUB_WORKSPACE/artifacts" | |
| mkdir "$GITHUB_WORKSPACE/artifacts/process-message" | |
| mkdir "$GITHUB_WORKSPACE/azure/accept_message/node_modules" | |
| - uses: actions/checkout@v2 | |
| - name: Set Version | |
| run: echo "PACKAGE_VERSION=$(Get-Date -Format "yyyy.M.d").${{ github.run_number }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| - name: Restore dependencies for process-message | |
| working-directory: azure/process_message/process_message | |
| run: dotnet restore | |
| - name: Build process-message | |
| working-directory: azure/process_message/process_message | |
| run: dotnet build --configuration Release --no-restore --output "$GITHUB_WORKSPACE/artifacts/process-message" | |
| - name: Install Octopus CLI | |
| uses: OctopusDeploy/install-octopus-cli-action@v1.1.1 | |
| with: | |
| version: latest | |
| - name: Pack and Push | |
| working-directory: azure/accept_message | |
| env: | |
| OCTOPUS_CLI_SERVER: ${{ secrets.OCTOPUS_SERVER }} | |
| OCTOPUS_CLI_PASSWORD: ${{ secrets.OCTOPUS_API_KEY }} | |
| run: | | |
| npm ci --production | |
| octo pack --id=OctoSubscriber-AcceptMessage-Function --format=Zip --version=${{ env.PACKAGE_VERSION }} --basePath="$GITHUB_WORKSPACE/azure/accept_message" | |
| octo pack --id=OctoSubscriber-ProcessMessage-Function --format=Zip --version=${{ env.PACKAGE_VERSION }} --basePath="$GITHUB_WORKSPACE/artifacts/process-message" | |
| octo push --package=OctoSubscriber-AcceptMessage-Function.${{ env.PACKAGE_VERSION }}.zip --space="Target - Serverless" | |
| octo push --package=OctoSubscriber-ProcessMessage-Function.${{ env.PACKAGE_VERSION }}.zip --space="Target - Serverless" |