Update hugo-build-deploy.yml #149
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
# delivery.yml | |
on: | |
push: | |
branches: [ trunk ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true # Fetch Hugo themes (true OR recursive) | |
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: '0.68.3' | |
# extended: true | |
- name: Build | |
run: hugo | |
- name: Install SSH Key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
name: exoscale | |
key: ${{ secrets.EXOSCALE_SSH_PRIVATE_KEY }} | |
known_hosts: "banana" | |
if_key_exists: replace | |
- name: Adding Exoscale to Known Hosts | |
run: | | |
ssh-keyscan -H ${{ secrets.EXOSCALE_SSH_HOST }} > ~/.ssh/known_hosts | |
- name: Deploy to exoscale | |
run: | | |
rsync -avzr --checksum -e "ssh -i ~/.ssh/exoscale" ./public/ ubuntu@${{ secrets.EXOSCALE_SSH_HOST }}:/www/wtcd/ | |
- uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Upload to blob storage | |
uses: azure/CLI@v1 | |
with: | |
azcliversion: 2.0.72 | |
inlineScript: | | |
az storage blob upload-batch --account-name wtcdsite -d '$web' -s public/. | |
- name: Purge CDN endpoint | |
uses: azure/CLI@v1 | |
with: | |
azcliversion: 2.0.72 | |
inlineScript: | | |
az cdn endpoint purge --content-paths "/*" --profile-name "wtcd-cdn-pf" --name "wtcd-cdn" --resource-group "wtcd" | |
- name: logout | |
run: | | |
az logout |