Add a staging config.yml for use when deploying to staging slot and r… #5
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
# 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: | |
push: | |
branches: | |
- master | |
workflow_dispatch: # Makes it possible to trigger workflow manually | |
jobs: | |
publish: | |
if: github.repository_owner == 'OData' && 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 |