Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dlutov authored Nov 6, 2024
1 parent ffaab89 commit 78bae3d
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Workflow

on:
push:
branches:
- publish

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Install dependencies
run: |
pip install petljadoc
pip install pyyaml
- name: Run petljadoc and get courseId
id: publish
run: |
petljadoc publish
COURSE_ID=$(python -c "import yaml; data = yaml.safe_load(open('docs/index.yaml')); print(data['courseId'])")
echo "::set-output name=courseId::$COURSE_ID"
- name: Install Azure CLI
run: |
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
- name: Upload to Azure Blob Storage
run: |
az storage blob upload-batch --source docs --destination publish/${{ steps.publish.outputs.courseId }} --pattern "*" --overwrite
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}

0 comments on commit 78bae3d

Please sign in to comment.