Skip to content

Commit

Permalink
feature/workflow-template: moving secret inputs to secrets section.
Browse files Browse the repository at this point in the history
  • Loading branch information
Breno RdV committed Feb 4, 2024
1 parent d8826af commit 374ea6f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/master-publish-dataapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
projectFile: Raccoon.Ninja.AzFn.DataApi.csproj
releaseFilePrefix: "AzFnDataApi"
publishToAzure: true
azureFunctionAppName: ${{ secrets.AZFN_DATA_API_APP_NAME }}
azurePublishProfile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_241C3F8D024847BCA5768768B873121E }}
secrets:
githubToken: ${{ secrets.GITHUB_TOKEN }}
azureFunctionAppName: ${{ secrets.AZFN_DATA_API_APP_NAME }}
azurePublishProfile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_241C3F8D024847BCA5768768B873121E }}
4 changes: 2 additions & 2 deletions .github/workflows/master-publish-datatransfer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
projectFile: Raccoon.Ninja.AzFn.DataTransfer.csproj
releaseFilePrefix: "AzFnDataTransfer"
publishToAzure: true
azureFunctionAppName: ${{ secrets.AZFN_DATA_TRANSFER_APP_NAME }}
azurePublishProfile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_4FA5B62EE7A54F0FB008C8F7AC985444 }}
secrets:
githubToken: ${{ secrets.GITHUB_TOKEN }}
azureFunctionAppName: ${{ secrets.AZFN_DATA_TRANSFER_APP_NAME }}
azurePublishProfile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_4FA5B62EE7A54F0FB008C8F7AC985444 }}
21 changes: 10 additions & 11 deletions .github/workflows/template-test-build-and-publish-to-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,17 @@ on:
description: '[Required] If true, the workflow will deploy the new release to the Azure Functions App.'
required: true
type: boolean

secrets:
githubToken:
description: '[Required] The GitHub token to use for the workflow.'
required: true
azureFunctionAppName:
description: '[Required only if publishToAzure is true] The name of the Azure Functions App to deploy to.'
required: false
type: string
azurePublishProfile:
description: '[Required only if publishToAzure is true] The Azure Publish Profile for deployment.'
required: false
type: string
secrets:
githubToken:
description: '[Required] The GitHub token to use for the workflow.'
required: true

jobs:
set_release_version:
Expand Down Expand Up @@ -159,15 +158,15 @@ jobs:
steps:
- name: Check Azure Function App Name
run: |
if [ -z "${{ inputs.azureFunctionAppName }}" ]; then
if [ -z "${{ secrets.azureFunctionAppName }}" ]; then
echo "Azure Function App Name (azureFunctionAppName) is empty or not set."
exit 1
else
echo "Azure Function App Name is set to '${{ inputs.azureFunctionAppName }}'."
echo "Azure Function App Name is set to '${{ secrets.azureFunctionAppName }}'."
fi
- name: Check Azure Publish Profile
run: |
if [ -z "${{ inputs.azurePublishProfile }}" ]; then
if [ -z "${{ secrets.azurePublishProfile }}" ]; then
echo "Azure Publish Profile (azurePublishProfile) is empty or not set."
exit 1
else
Expand Down Expand Up @@ -262,10 +261,10 @@ jobs:
uses: Azure/functions-action@v1
if: inputs.publishToAzure == true
with:
app-name: ${{ inputs.azureFunctionAppName }}
app-name: ${{ secrets.azureFunctionAppName }}
slot-name: 'Production'
package: './output'
publish-profile: ${{ inputs.azurePublishProfile }}
publish-profile: ${{ secrets.azurePublishProfile }}

- name: Create Tag
if: needs.check_tag.outputs.tag_exists == false
Expand Down

0 comments on commit 374ea6f

Please sign in to comment.