Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornweb committed Apr 5, 2024
2 parents 3b11d8c + 2341bad commit ef0b381
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 8 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/azure-static-web-apps-witty-bay-023aafb10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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: 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_WITTY_BAY_023AAFB10 }}
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: "/" # App source code path
api_location: "" # Api source code path - optional
output_location: "" # 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_WITTY_BAY_023AAFB10 }}
action: "close"
51 changes: 51 additions & 0 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy Node.js app to Azure Web App - tourismapp
name: Build and deploy Node.js app to Azure Web App - slipspace

on:
push:
Expand Down Expand Up @@ -57,15 +57,15 @@ jobs:
- name: Login to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_849EE681969D46B38024FDDA459F42EE }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_FEC0EE3155C2482DA5152AE90582B05F }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_86B30A8FC7AA43B68B2B924AEBD96748 }}
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_8D61FDF6CC7E404A98BC96270945C9F7 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_D0F9FEB8912341D0A5A96465DB76B94E }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_4B37E3B0B485419C98F491DEA14A2506 }}

- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'tourismapp'
app-name: 'slipspace'
slot-name: 'Production'
package: .

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "CI=false && react-scripts build",
"test": "react-scripts test --passWithNoTests",
"start": "node server.js",
"dev": "react-scripts build",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
Expand Down

0 comments on commit ef0b381

Please sign in to comment.