-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub action workflow for publishing OData org website to produc…
…tion (#353) * Add GitHub action workflow for publishing OData org website to production * Production and staging workflows to publish site should be triggered manually
- Loading branch information
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# 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 --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 |
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