Skip to content

Commit 45d175e

Browse files
committed
update workflows - M2 and M3
1 parent e70ac1f commit 45d175e

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

.github/workflows/AZ2007_Zip_Code_M2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
steps:
4848
- name: Checkout
4949
uses: actions/checkout@v4
50-
- name: Create LP1 SampleApps zip
50+
- name: Create AZ2007M2 SampleApps zip
5151
run: |
5252
cd ./DownloadableCodeProjects/az-2007-m2-explain-document
5353
rm -f ../Downloads/AZ2007LabAppM2.zip
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# This workflow is triggered on two events: workflow_dispatch and push.
2+
#
3+
# - The workflow_dispatch event allows you to manually trigger the workflow from GitHub's UI.
4+
# - The push event triggers the workflow whenever there's a push to the master branch, but only
5+
# if the changes include files in the LearnModuleExercises/SampleApps/** directory.
6+
#
7+
# The defaults section sets the default shell for all run commands in the workflow to PowerShell (pwsh).
8+
#
9+
# The workflow consists of a single job named create_zip, which runs on the latest version of Ubuntu.
10+
#
11+
# This job has three steps:
12+
#
13+
# 1. The Checkout step uses the actions/checkout@v4 action to checkout the repository's code onto the
14+
# runner. This is a common first step in most workflows as it allows subsequent steps to operate on
15+
# the codebase.
16+
#
17+
# 2. The Create SampleApps zip step changes the current directory to ./LearnModuleExercises/SampleApps
18+
# and then creates a zip file of all the files in that directory, including those in the .vscode
19+
# subdirectory. The -r option is used to zip directories recursively and the -q option is used to run
20+
# the command quietly without printing a lot of output. The resulting zip file is saved in the
21+
# ../Downloads directory with the name SampleApps.zip.
22+
#
23+
# 3. The Commit and push step uses the Endbug/add-and-commit@v7 action to add the newly created zip file
24+
# to the repository, commit the changes with the message 'Updating Zip for API source files', and then
25+
# push the changes back to the repository. The add input is set to the path of the zip file and the push
26+
# input is set to true to enable pushing.
27+
#
28+
# This workflow is useful for automatically packaging and versioning sample applications whenever changes
29+
# are made to them.
30+
#
31+
name: CreateAZ2007M3SamplesZip
32+
on:
33+
workflow_dispatch:
34+
push:
35+
branches:
36+
- 'main'
37+
paths:
38+
- DownloadableCodeProjects/az-2007-m3-develop-code/**
39+
40+
defaults:
41+
run:
42+
shell: pwsh
43+
44+
jobs:
45+
create_zip:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
- name: Create AZ2007M3 SampleApps zip
51+
run: |
52+
cd ./DownloadableCodeProjects/az-2007-m3-develop-code
53+
rm -f ../Downloads/AZ2007LabAppM3.zip
54+
zip -r -q ../Downloads/AZ2007LabAppM3.zip $(git ls-files)
55+
- name: Commit and push
56+
uses: Endbug/add-and-commit@v7
57+
with:
58+
add: '["DownloadableCodeProjects/Downloads/AZ2007LabAppM3.zip"]'
59+
message: 'Updating Zip with sample app source files'
60+
push: true

0 commit comments

Comments
 (0)