Skip to content

Commit

Permalink
feat(github-actions): deploy azure static app
Browse files Browse the repository at this point in the history
  • Loading branch information
mildronize committed May 17, 2024
1 parent 74f9378 commit 0f7f1c8
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 34 deletions.
94 changes: 60 additions & 34 deletions .github/workflows/azure-static-web-apps-jolly-bay-0c013ea00.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,69 @@ 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_JOLLY_BAY_0C013EA00 }}
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_JOLLY_BAY_0C013EA00 }}
action: "close"
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: bun install

- name: Build
run: bun run build

- name: Deploy
run: bun run deploy
env:
SWA_CLI_DEPLOYMENT_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_JOLLY_BAY_0C013EA00 }}

# 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_JOLLY_BAY_0C013EA00 }}
# 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_JOLLY_BAY_0C013EA00 }}
# action: "close"
Binary file modified bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"module": "index.ts",
"type": "module",
"devDependencies": {
"@azure/static-web-apps-cli": "^1.1.7",
"@shikijs/vitepress-twoslash": "^1.5.2",
"@types/bun": "latest",
"vitepress": "^1.1.4",
Expand All @@ -14,6 +15,7 @@
"scripts": {
"dev": "vitepress dev docs",
"build": "vitepress build docs",
"deploy": "swa deploy ./docs/.vitepress/dist --env production -n thadaw-type-safe",
"preview": "vitepress preview docs"
}
}

0 comments on commit 0f7f1c8

Please sign in to comment.