Changing setting back #38
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
# This workflow is used to generate a new version of JonathanGiles.net and push it to Azure Blob Storage. | |
name: CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Based on https://medium.com/@shilyndon/purging-azure-cdn-with-github-actions-1c18e2adaf18 | |
- name: Azure service principal login | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Cache Maven packages | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Build with Maven and generate static site | |
run: mvn --batch-mode package exec:java | |
- name: Upload to Azure Blob Storage | |
uses: bacongobbler/[email protected] | |
with: | |
source_dir: 'output' | |
container_name: '$web' | |
connection_string: ${{ secrets.ConnectionString }} | |
sync: 'true' | |
- name: Purge Azure CDN | |
uses: svanboxel/azure-purge-cdn@main | |
with: | |
cdn_endpoint: Jonathangiles | |
cdn_profile_name: ${{ secrets.AZURE_CDN_PROFILE_NAME }} | |
resource_group: ${{ secrets.AZURE_RESOURCE_GROUP }} | |
- name: Azure service principal logout | |
run: | | |
az logout |