-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
1 changed file
with
91 additions
and
91 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,92 +1,92 @@ | ||
name: Azure Static Web Apps CI/CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize, reopened, closed] | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_and_deploy_job: | ||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') || github.event_name == 'workflow_dispatch' | ||
runs-on: ubuntu-latest | ||
name: Build and Deploy Job | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
path: YarnSpinnerJS | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/[email protected] | ||
|
||
- name: Clean install dependencies | ||
run: npm ci | ||
working-directory: ./YarnSpinnerJS | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 6.0.x | ||
|
||
- uses: gittools/actions/gitversion/[email protected] | ||
name: Install GitVersion | ||
with: | ||
versionSpec: '5.x' | ||
name: Azure Static Web Apps CI/CD | ||
|
||
- name: Clone development Yarn Spinner | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: YarnSpinnerTool/YarnSpinner | ||
path: YarnSpinner | ||
fetch-depth: 0 | ||
|
||
# Update the version info for the version of Yarn Spinner we're about to | ||
# build | ||
- uses: gittools/actions/gitversion/[email protected] | ||
name: Execute GitVersion | ||
with: | ||
targetPath: ./YarnSpinner | ||
updateAssemblyInfo: true | ||
|
||
- name: Build Yarn Spinner .DLL | ||
working-directory: ./YarnSpinnerJS | ||
run: dotnet publish -c Debug -p:YarnSpinnerDevelopmentPath=../YarnSpinner try.yarnspinner.dev.sln | ||
|
||
- name: Build webpack | ||
working-directory: ./YarnSpinnerJS | ||
run: npm run build | ||
env: | ||
DELETE_ORIGINAL_ASSETS: 1 | ||
BASE_URL: "https://try.yarnspinner.dev/" | ||
|
||
- name: Build and Deploy to Azure | ||
id: builddeploy | ||
uses: Azure/static-web-apps-deploy@v1 | ||
with: | ||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROUD_MEADOW_05B0B9E1E }} | ||
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: "YarnSpinnerJS/dist" # App source code path | ||
api_location: "" # Api source code path - optional | ||
output_location: "" # Built app content directory - optional | ||
skip_app_build: true | ||
###### 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_PROUD_MEADOW_05B0B9E1E }} | ||
action: "close" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize, reopened, closed] | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_and_deploy_job: | ||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') || github.event_name == 'workflow_dispatch' | ||
runs-on: ubuntu-latest | ||
name: Build and Deploy Job | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
path: YarnSpinnerJS | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/[email protected] | ||
|
||
- name: Clean install dependencies | ||
run: npm ci | ||
working-directory: ./YarnSpinnerJS | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 6.0.x | ||
|
||
- uses: gittools/actions/gitversion/[email protected] | ||
name: Install GitVersion | ||
with: | ||
versionSpec: "6.x" | ||
|
||
- name: Clone development Yarn Spinner | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: YarnSpinnerTool/YarnSpinner | ||
path: YarnSpinner | ||
fetch-depth: 0 | ||
|
||
# Update the version info for the version of Yarn Spinner we're about to | ||
# build | ||
- uses: gittools/actions/gitversion/[email protected] | ||
name: Execute GitVersion | ||
with: | ||
targetPath: ./YarnSpinner | ||
updateAssemblyInfo: true | ||
|
||
- name: Build Yarn Spinner .DLL | ||
working-directory: ./YarnSpinnerJS | ||
run: dotnet publish -c Debug -p:YarnSpinnerDevelopmentPath=../YarnSpinner try.yarnspinner.dev.sln | ||
|
||
- name: Build webpack | ||
working-directory: ./YarnSpinnerJS | ||
run: npm run build | ||
env: | ||
DELETE_ORIGINAL_ASSETS: 1 | ||
BASE_URL: "https://try.yarnspinner.dev/" | ||
|
||
- name: Build and Deploy to Azure | ||
id: builddeploy | ||
uses: Azure/static-web-apps-deploy@v1 | ||
with: | ||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROUD_MEADOW_05B0B9E1E }} | ||
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: "YarnSpinnerJS/dist" # App source code path | ||
api_location: "" # Api source code path - optional | ||
output_location: "" # Built app content directory - optional | ||
skip_app_build: true | ||
###### 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_PROUD_MEADOW_05B0B9E1E }} | ||
action: "close" |