Skip to content

Commit 9646d17

Browse files
authored
Add GitHub Actions workflow for publishing odata.org site to Azure App Service Staging Slot (#349)
1 parent ecc25be commit 9646d17

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
2+
# More on GitHub Actions for Azure: https://github.com/Azure/actions
3+
# More on OpenID Connect: https://github.com/azure/login#github-action-for-azure-login
4+
5+
name: Publish OData org website to Azure Web App staging slot
6+
7+
on:
8+
push:
9+
branches:
10+
- master
11+
workflow_dispatch: # Makes it possible to trigger workflow manually
12+
13+
jobs:
14+
build_and_deploy_job:
15+
permissions: # Required when using OpenID Connect based federated identity credentials
16+
id-token: write
17+
contents: read
18+
19+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
with:
25+
lfs: true # Forces LFS files (images in our case) to be checked out
26+
submodules: 'recursive' # Check out submodules if applicable
27+
28+
- name: Build the site in a jekyll/builder container
29+
run: |
30+
docker run \
31+
-v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \
32+
jekyll/builder:stable /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future"
33+
34+
- name: Log in with Azure # Using OpenID Connect
35+
uses: azure/login@v1
36+
with:
37+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
38+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
39+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
40+
41+
- name: Deploy to Azure Web App
42+
uses: azure/webapps-deploy@v2
43+
with:
44+
app-name: 'odata-prod'
45+
slot-name: 'odata-prod-stage' # Specify the staging slot
46+
package: ${{ github.workspace }}/_site

0 commit comments

Comments
 (0)