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

Auth - Fix for netlify + improve actions naming #57

Merged
merged 1 commit into from
Jul 5, 2024
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
184 changes: 92 additions & 92 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,83 +1,83 @@
name: build
name: PR + Staging - Build and Deploy

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET 8.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x

- name: Restore dependencies
working-directory: SSW.Rules.AzFuncs/
run: dotnet restore

- name: Build
working-directory: SSW.Rules.AzFuncs/
run: dotnet build --no-restore

- name: Deploy
working-directory: SSW.Rules.AzFuncs/
run: |
dotnet publish \
--configuration Release \
--output ../deploy

- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: functionsapp
path: deploy
- uses: actions/checkout@v2
- name: Setup .NET 8.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x

- name: Restore dependencies
working-directory: SSW.Rules.AzFuncs/
run: dotnet restore

- name: Build
working-directory: SSW.Rules.AzFuncs/
run: dotnet build --no-restore

- name: Deploy
working-directory: SSW.Rules.AzFuncs/
run: |
dotnet publish \
--configuration Release \
--output ../deploy

- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: functionsapp
path: deploy

validate-resources:
runs-on: ubuntu-latest
environment: staging

steps:
- uses: actions/checkout@v2
- name: Setup .NET 8.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x

- name: Generate ARM Template
working-directory: Azure/
run: dotnet run
env:
- uses: actions/checkout@v2
- name: Setup .NET 8.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x

- name: Generate ARM Template
working-directory: Azure/
run: dotnet run
env:
AUTH0_AUDIENCE: ${{ secrets.AUTH0_AUDIENCE }}
AUTH0_ISSUER: ${{ secrets.AUTH0_ISSUER }}
AZURE_RG_PREFIX: ${{ secrets.AZURE_RG_PREFIX }}
GITHUB_TOKEN: ${{ secrets.AZ_FUNC_GITHUB_PAT}}
CMS_OAUTH_CLIENT_ID: ${{ secrets.CMS_OAUTH_CLIENT_ID }}
CMS_OAUTH_CLIENT_SECRET: ${{ secrets.CMS_OAUTH_CLIENT_SECRET }}

- name: Login with Azure CLI
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Run ARM deploy
uses: azure/arm-deploy@v1
with:
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }}
resourceGroupName: ${{ secrets.AZURE_RG }}
template: Azure/arm-template.json
deploymentMode: Validate

- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: arm-template
path: Azure/arm-template.json
CMS_OAUTH_CLIENT_ID: ${{ secrets.STAGING_CMS_OAUTH_CLIENT_ID }}
CMS_OAUTH_CLIENT_SECRET: ${{ secrets.STAGING_CMS_OAUTH_CLIENT_SECRET }}

- name: Login with Azure CLI
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Run ARM deploy
uses: azure/arm-deploy@v1
with:
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }}
resourceGroupName: ${{ secrets.AZURE_RG }}
template: Azure/arm-template.json
deploymentMode: Validate

- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: arm-template
path: Azure/arm-template.json

deploy:
needs: [build, validate-resources]
Expand All @@ -86,35 +86,35 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v2
with:
name: arm-template

- name: Login with Azure CLI
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Run ARM deploy
uses: azure/arm-deploy@v1
with:
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }}
resourceGroupName: ${{ secrets.AZURE_RG }}
template: arm-template.json

- name: Setup .NET 8.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x

- uses: actions/download-artifact@v2
with:
name: functionsapp
path: deploy

- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: ${{ secrets.AZURE_RG_PREFIX }}-functions
package: deploy
- uses: actions/download-artifact@v2
with:
name: arm-template

- name: Login with Azure CLI
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Run ARM deploy
uses: azure/arm-deploy@v1
with:
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }}
resourceGroupName: ${{ secrets.AZURE_RG }}
template: arm-template.json

- name: Setup .NET 8.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x

- uses: actions/download-artifact@v2
with:
name: functionsapp
path: deploy

- name: "Run Azure Functions Action"
uses: Azure/functions-action@v1
id: fa
with:
app-name: ${{ secrets.AZURE_RG_PREFIX }}-functions
package: deploy
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: Production - Build and Deploy

on:
push:
Expand Down
Loading