Skip to content

Commit 0ee11ed

Browse files
committed
adding yaml snippets for all languages
1 parent 2b35cb6 commit 0ee11ed

File tree

1 file changed

+87
-3
lines changed

1 file changed

+87
-3
lines changed

articles/azure-functions/functions-how-to-github-actions.md

Lines changed: 87 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ Setting up the environment can be done using one of the publish setup actions.
6262
|**JavaScript** | `actions/setup-node` |
6363
|**Python** | `actions/setup-python` |
6464

65-
A snippet from the yaml file for a JavaScript app that uses version 10
65+
A snippet from the yaml file for:
66+
67+
**JavaScript**
6668

6769
```yaml
6870
- name: 'Login via Azure CLI'
@@ -75,11 +77,54 @@ A snippet from the yaml file for a JavaScript app that uses version 10
7577
node-version: '10.x'
7678
```
7779
80+
**Python**
81+
82+
```yaml
83+
- name: 'Login via Azure CLI'
84+
uses: Azure/actions/login@master
85+
with:
86+
creds: ${{ secrets.AZURE_CREDENTIALS }}
87+
- name: Setup Python 3.6
88+
uses: actions/setup-python@v1
89+
with:
90+
python-version: 3.6
91+
```
92+
93+
**Dot Net**
94+
95+
```yaml
96+
- name: 'Login via Azure CLI'
97+
uses: Azure/actions/login@master
98+
with:
99+
creds: ${{ secrets.AZURE_CREDENTIALS }}
100+
- name: Setup Dotnet 2.2.300
101+
uses: actions/setup-dotnet@v1
102+
with:
103+
dotnet-version: '2.2.300'
104+
```
105+
106+
**Java**
107+
108+
```yaml
109+
- name: 'Login via Azure CLI'
110+
uses: Azure/actions/login@master
111+
with:
112+
creds: ${{ secrets.AZURE_CREDENTIALS }}
113+
- name: Setup Java 1.8.x
114+
uses: actions/setup-java@v1
115+
with:
116+
# If your pom.xml <maven.compiler.source> version is not in 1.8.x
117+
# Please change the Java version to match the version in pom.xml <maven.compiler.source>
118+
java-version: '1.8.x'
119+
```
120+
78121
## Build the function app
79122
80123
This depends on the language and for languages supported by Azure Functions, this section should be the standard build steps of each language.
81124
82-
A snippet from the yaml file for a JavaScript app
125+
A snippet from the yaml file for:
126+
127+
**JavaScript app**
83128
84129
```yaml
85130
- name: 'Run npm'
@@ -94,7 +139,46 @@ A snippet from the yaml file for a JavaScript app
94139
popd
95140
```
96141
97-
This depends on the language and for languages supported by Azure Functions, this section should be the standard build steps of each language
142+
**Python**
143+
144+
```yaml
145+
- name: 'Run pip'
146+
shell: bash
147+
run: |
148+
# If your function app project is not located in your repository's root
149+
# Please change your directory for pip in pushd
150+
pushd .
151+
python -m pip install --upgrade pip
152+
pip install -r requirements.txt --target=".python_packages/lib/python3.6/site-packages"
153+
popd
154+
```
155+
156+
**Dot Net**
157+
158+
```yaml
159+
- name: 'Run dotnet build'
160+
shell: bash
161+
run: |
162+
# If your function app project is not located in your repository's root
163+
# Please consider using pushd to change your path
164+
pushd .
165+
dotnet build --configuration Release --output ./output
166+
popd
167+
```
168+
169+
**Java**
170+
171+
```yaml
172+
- name: 'Run mvn'
173+
shell: bash
174+
run: |
175+
# If your function app project is not located in your repository's root
176+
# Please change your directory for maven build in pushd
177+
pushd . ./POM_ARTIFACT_ID
178+
mvn clean package
179+
mvn azure-functions:package
180+
popd
181+
```
98182
99183
## Deploy the function app
100184

0 commit comments

Comments
 (0)