vanillajs-deck/.github/workflows/main.yml

59 lines
1.7 KiB
YAML
Raw Permalink Normal View History

name: Build and Deploy Vanilla.js
env:
2020-01-29 21:27:36 +00:00
OUTPUT_PATH: ${{ github.workspace }}/.output/
on:
push:
branches:
- master
jobs:
build_website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
2020-01-31 23:46:33 +00:00
- name: Copy files
2020-01-29 21:27:36 +00:00
run: |
mkdir ${{ env.OUTPUT_PATH }}
2020-01-29 21:27:36 +00:00
cp index.html favicon.ico manifest.json pwa.js robots.txt ${{ env.OUTPUT_PATH }}
cp -r css/ ${{ env.OUTPUT_PATH }}css/
cp -r images/ ${{ env.OUTPUT_PATH }}images/
cp -r videos/ ${{ env.OUTPUT_PATH }}videos/
cp -r js/ ${{ env.OUTPUT_PATH }}js/
cp -r slides/ ${{ env.OUTPUT_PATH }}slides/
cp -r templates/ ${{ env.OUTPUT_PATH }}templates/
cp -r appicons/ ${{ env.OUTPUT_PATH }}appicons/
- name: Publish website output
uses: actions/upload-artifact@v1
with:
name: website
path: ${{ env.OUTPUT_PATH }}
deploy_website:
runs-on: ubuntu-latest
needs: [build_website]
env:
STORAGE_NAME: jlikme
RG_NAME: jlik-me
steps:
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Download website
uses: actions/download-artifact@v1
with:
name: website
path: ${{ env.OUTPUT_PATH }}
2020-01-29 21:27:36 +00:00
- name: Fix Base URL
2020-01-29 21:54:59 +00:00
run: |
sed -i "s/base href=\"\/\"/base href=\"\/vanillajs\/\"/g" ${{ env.OUTPUT_PATH }}index.html
2020-01-29 22:03:43 +00:00
sed -i "s/scope: '\/'/scope: '\/vanillajs\/'/g" ${{ env.OUTPUT_PATH }}index.html
2020-01-29 21:54:59 +00:00
- name: Deploy to Azure Storage
run: az storage blob upload-batch --source ${{ env.OUTPUT_PATH }} --destination \$web/vanillajs --account-name ${STORAGE_NAME}