Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .devcontainer/product_name-language-topic2/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "Tutorial: product_name-language-topic2",
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm",
"workspaceFolder": "/workspaces/tutorial-interactive_tutorials/tutorials/product_name-language-topic2",
"waitFor": "onCreateCommand",
"updateContentCommand": "npm install",
"postCreateCommand": "",
"postAttachCommand": "nohup ./node_modules/.bin/http-server steps -p 1234 --cors -c-1 > /dev/null 2>&1 & wait",
"forwardPorts": [
"1234"
],
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"customizations": {
"vscode": {
"extensions": [],
"settings": {
"editor.formatOnSave": true,
"files.exclude": {
"node_modules": true,
"dist": true,
"steps": true,
".devcontainer": true,
".vscode": true,
"package.json": true,
"package-lock.json": true,
"tutorial-config.json": true,
"tsconfig.json": true,
"astro.config.mjs": true,
".git": true,
".DS_Store": true,
"__MACOSX": true,
"README.md": true,
"markdoc.config.mjs": true,
"project/setup-project.js": true
}
}
},
"codespaces": {
"openFiles": [
"customer.js",
"index.html"
]
}
},
"portsAttributes": {
"1234": {
"label": "Tutorial Guide",
"onAutoForward": "openPreview"
}
}
}
40 changes: 40 additions & 0 deletions .github/workflows/ingest-tutorial.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Ingest Tutorial Content

on:
push:
paths:
- 'uploads/**.zip'
workflow_dispatch:

jobs:
process-upload:
runs-on: ubuntu-latest
permissions:
contents: write # Necessary to push the generated files back

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Install Script Dependencies
# Installing dependencies for the processor script dynamically
run: npm install fs-extra unzipper

- name: Run Processor Script
run: node scripts/process-tutorial.js

- name: Commit and Push Changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "🤖 Auto-generate tutorial environment [skip ci]: ${{ github.event.head_commit.message }}"
branch: ${{ github.ref }}
# Ensure we track the new folders
# file_pattern: |
# tutorials/
# .devcontainer/
# uploads/
148 changes: 148 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dependencies": {
"fs-extra": "^11.3.3",
"unzipper": "^0.12.3"
}
}
Loading