-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8583a2
commit 2a304e6
Showing
3 changed files
with
76 additions
and
47 deletions.
There are no files selected for viewing
46 changes: 0 additions & 46 deletions
46
.github/workflows/azure-static-web-apps-zealous-plant-083d54e10.yml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Azure Static Web Apps CI/CD | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
pull_request: | ||
types: [opened, synchronize, reopened, closed] | ||
branches: ['main'] | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
env: | ||
NODE_VERSION: '22.x' | ||
|
||
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 | ||
environment: ${{ github.event_name == 'push' && 'Production' || 'Staging' }} | ||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
lfs: false | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Verify formatting | ||
run: npm run lint:check | ||
|
||
- name: Build sources | ||
run: npm run build | ||
|
||
- name: Deploy static web app | ||
id: deploy | ||
uses: Azure/static-web-apps-deploy@v1 | ||
env: | ||
SKIP_DEPLOY_ON_MISSING_SECRETS: ${{ github.event_name == 'pull_request' }} | ||
IS_STATIC_EXPORT: true | ||
with: | ||
azure_static_web_apps_api_token: ${{ secrets.AZURE_SWA_TOKEN }} | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
action: 'upload' | ||
app_location: 'out' | ||
skip_app_build: true | ||
skip_api_build: true | ||
|
||
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 | ||
env: | ||
SKIP_DEPLOY_ON_MISSING_SECRETS: ${{ github.event_name == 'pull_request' }} | ||
with: | ||
azure_static_web_apps_api_token: ${{ secrets.AZURE_SWA_TOKEN }} | ||
action: 'close' | ||
app_location: '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters