-
Notifications
You must be signed in to change notification settings - Fork 102
36 lines (29 loc) · 1.58 KB
/
publish_to_production_slot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More on GitHub Actions for Azure: https://github.com/Azure/actions
# More on GitHub Action for Azure Login: https://github.com/azure/login#github-action-for-azure-login
name: Publish OData org website to Azure Web App production slot
on:
workflow_dispatch: # Makes it possible to trigger workflow manually
jobs:
publish:
if: github.repository_owner == 'OData' && github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true # Forces LFS files (images in our case) to be checked out
submodules: 'recursive' # Check out submodules if applicable
- name: Build the site in a jekyll/builder container
run: |
docker run \
-v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \
jekyll/builder:stable /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --config _config.yml --future"
- name: Log in with Azure # Using Azure Service Principal
uses: azure/login@v1
with:
creds: '{"clientId":"${{ secrets.AZURE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}'
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
with:
app-name: 'odata-prod'
package: ${{ github.workspace }}/_site