Skip to content

Commit

Permalink
Use GitVersion 6
Browse files Browse the repository at this point in the history
  • Loading branch information
desplesda committed Nov 30, 2024
1 parent 71f3d37 commit daad241
Showing 1 changed file with 91 additions and 91 deletions.
182 changes: 91 additions & 91 deletions .github/workflows/build-and-deploy.yml
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"

0 comments on commit daad241

Please sign in to comment.