Skip to content

Commit

Permalink
Merge branch 'main' of github.com:sjohn198/SafeHaven
Browse files Browse the repository at this point in the history
  • Loading branch information
BrawlPaul committed Jun 3, 2024
2 parents a837369 + 5d9908c commit 2c684c5
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 11 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/azure-static-web-apps-red-field-0505d1e1e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Azure Static Web Apps CI/CD

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main

jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v3
with:
submodules: true
lfs: false
- name: Install dependencies
run: npm ci
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_RED_FIELD_0505D1E1E }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "./packages/react-frontend" # App source code path
api_location: "" # Api source code path - optional
output_location: "dist" # Built app content directory - optional
###### End of Repository/Build Configurations ######

close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_RED_FIELD_0505D1E1E }}
action: "close"
23 changes: 12 additions & 11 deletions .github/workflows/main_safehaven307.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ jobs:
with:
node-version: '18.x'

- name: npm install, build, and test
- name: npm ci, install, build, and test
run: |
npm ci
npm install
npm run build --if-present
npm run test --if-present
Expand All @@ -42,8 +43,8 @@ jobs:
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
permissions:
id-token: write #This is required for requesting the JWT
permissions:
id-token: write #This is required for requesting the JWT

steps:
- name: Download artifact from build job
Expand All @@ -53,13 +54,13 @@ jobs:

- name: Unzip artifact for deployment
run: unzip release.zip

- name: Login to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_8E035D0A5DBB427DB4E111FD5E29588D }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_DF80774E585345278225BFF2A80D3DAC }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_88658FF7ABDD4CC29352BE0098BD19FB }}

- name: Login to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_8E035D0A5DBB427DB4E111FD5E29588D }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_DF80774E585345278225BFF2A80D3DAC }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_88658FF7ABDD4CC29352BE0098BD19FB }}

- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
Expand All @@ -68,4 +69,4 @@ jobs:
app-name: 'SafeHaven307'
slot-name: 'Production'
package: .


0 comments on commit 2c684c5

Please sign in to comment.