Skip to content

Commit

Permalink
Use OIDC creds to deploy (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
camertron committed Jun 6, 2023
1 parent 3d9c631 commit 4b81816
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:

workflow_dispatch:

permissions:
id-token: write
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -46,6 +50,13 @@ jobs:
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Az CLI login
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Download artifact from build job
uses: actions/download-artifact@v2
with:
Expand All @@ -57,5 +68,4 @@ jobs:
with:
app-name: 'primerstyle'
slot-name: 'production'
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE }}
package: .
12 changes: 11 additions & 1 deletion .github/workflows/deploy_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:

workflow_dispatch:

permissions:
id-token: write
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -46,6 +50,13 @@ jobs:
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Az CLI login
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_STAGING_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Download artifact from build job
uses: actions/download-artifact@v2
with:
Expand All @@ -57,5 +68,4 @@ jobs:
with:
app-name: 'primerstyle'
slot-name: 'staging'
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE_STAGING }}
package: .

0 comments on commit 4b81816

Please sign in to comment.