-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
copied this code to defaultLabels.yml for testing
- Loading branch information
1 parent
0d666eb
commit 79292b3
Showing
1 changed file
with
98 additions
and
28 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,35 +1,105 @@ | ||
name: setting-default-labels | ||
# 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 to Azure App Services | ||
|
||
# Controls when the action will run. | ||
on: | ||
schedule: | ||
- cron: "0 0/3 * * *" | ||
push: | ||
branches: | ||
- updated_contents | ||
schedule: | ||
- cron: "0 0/3 * * *" | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
build: | ||
# The type of runner that the job will run on | ||
build-and-deploy-dotnet-app: | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
- uses: actions/stale@v3 | ||
name: Setting issue as idle | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
stale-issue-message: 'This issue is idle because it has been open for 14 days with no activity.' | ||
stale-issue-label: 'idle' | ||
days-before-stale: 14 | ||
days-before-close: -1 | ||
operations-per-run: 100 | ||
exempt-issue-labels: 'backlog' | ||
|
||
- uses: actions/stale@v3 | ||
name: Setting PR as idle | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
stale-pr-message: 'This PR is idle because it has been open for 14 days with no activity.' | ||
stale-pr-label: 'idle' | ||
days-before-stale: 14 | ||
days-before-close: -1 | ||
operations-per-run: 100 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Modify the sample app | ||
run: | | ||
cp -r ./__tests__/dotnetsampleapp dotnetapp | ||
current_utc_time=$(date -u +"%Y-%m-%d %H:%M:%S %Z") | ||
sed -i "s/<<<net-place-holder>>>/$current_utc_time/g" dotnetapp/Controllers/HelloController.cs | ||
echo "The placeholder has been replaced with current UTC time: $current_utc_time" | ||
- name: Set up .NET Core | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: '8.x' | ||
|
||
- name: Build with dotnet | ||
run: dotnet build --configuration Release dotnetapp/DOTNET_8_APP.csproj | ||
|
||
- name: dotnet publish | ||
run: dotnet publish dotnetapp/DOTNET_8_APP.csproj -c Release -o myapp | ||
|
||
- name: Upload artifact for deployment job | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: .net-app | ||
path: myapp | ||
|
||
- name: Login to Azure | ||
uses: azure/login@v2 | ||
with: | ||
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID }} | ||
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID }} | ||
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID }} | ||
|
||
- name: Deploy to Azure Web App | ||
id: deploy-to-webapp | ||
uses: azure/webapps-deploy@v3 | ||
with: | ||
app-name: 'lwasv2-euap-dotnet-githubactionstest' | ||
slot-name: 'Production' | ||
package: . | ||
|
||
build-and-deploy-node-app: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js version | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
|
||
- name: npm install, build, and test | ||
run: | | ||
cd __tests__/nodesampleapp | ||
npm install | ||
npm run build --if-present | ||
npm run test --if-present | ||
- name: Zip artifact for deployment | ||
run: | | ||
cd __tests__/nodesampleapp | ||
zip release.zip ./* -r | ||
- name: Upload artifact for deployment job | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: node-app | ||
path: release.zip | ||
|
||
- name: Unzip artifact for deployment | ||
run: unzip release.zip | ||
|
||
- name: Login to Azure | ||
uses: azure/login@v2 | ||
with: | ||
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_D673514B6B844964A5F6FFC61D392F0B }} | ||
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_B2C988C781F444929603CC1514D9D043 }} | ||
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_3D739CA9833E4DC881A48CA31F2DFE2D }} | ||
|
||
- name: 'Deploy to Azure Web App' | ||
id: deploy-to-webapp | ||
uses: azure/webapps-deploy@v3 | ||
with: | ||
app-name: 'lwasv2-euap-node-18-githubactions' | ||
slot-name: 'Production' | ||
package: . |