Skip to content

Commit

Permalink
Merge pull request #9 from ks6088ts-labs/feature/issue-8_gh-pages
Browse files Browse the repository at this point in the history
add github pages
  • Loading branch information
ks6088ts authored Oct 16, 2024
2 parents f5e9ae1 + ab066b0 commit c7d7d43
Show file tree
Hide file tree
Showing 8 changed files with 655 additions and 19 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/github-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: github-pages
on:
push:
branches:
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,18 @@ docker-scan: ## scan Docker image

.PHONY: ci-test-docker
ci-test-docker: docker-lint docker-build docker-scan docker-run ## run CI test for Docker

# ---
# Docs
# ---

.PHONY: docs
docs: ## build documentation
poetry run mkdocs build

.PHONY: docs-serve
docs-serve: ## serve documentation
poetry run mkdocs serve

.PHONY: ci-test-docs
ci-test-docs: docs ## run CI test for documentation
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[![docker](https://github.com/ks6088ts-labs/workshop-azure-iot/actions/workflows/docker.yaml/badge.svg?branch=main)](https://github.com/ks6088ts-labs/workshop-azure-iot/actions/workflows/docker.yaml?query=branch%3Amain)
[![docker-release](https://github.com/ks6088ts-labs/workshop-azure-iot/actions/workflows/docker-release.yaml/badge.svg)](https://github.com/ks6088ts-labs/workshop-azure-iot/actions/workflows/docker-release.yaml)
[![ghcr-release](https://github.com/ks6088ts-labs/workshop-azure-iot/actions/workflows/ghcr-release.yaml/badge.svg)](https://github.com/ks6088ts-labs/workshop-azure-iot/actions/workflows/ghcr-release.yaml)
[![github-pages](https://github.com/ks6088ts-labs/workshop-azure-iot/actions/workflows/github-pages.yaml/badge.svg)](https://github.com/ks6088ts-labs/workshop-azure-iot/actions/workflows/github-pages.yaml)

# workshop-azure-iot

Expand Down
29 changes: 11 additions & 18 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
# References
# workshop-azure-iot

## Azure Functions
This repository is for a workshop using Azure IoT services.

Run the function app locally
## Prerequisites

```shell
# Run the function app locally with the Azure Functions Core Tools
$ poetry run func start
```
To run all the projects in this repository, you need the followings.

Deploy the function app to Azure
- [Python 3.10+](https://www.python.org/downloads/)
<!-- add services here -->

```shell
# Deploy resources to Azure
$ bash scripts/deploy_azure_functions_resources.sh
Here are the preferred tools for development.

$ export FUNCTION_APP_NAME="CHANGE_ME"
- [Poetry](https://python-poetry.org/docs/#installation)
- [GNU Make](https://www.gnu.org/software/make/)

# Publish the function app to Azure
$ bash scripts/publish_azure_functions.sh
```
## Scenarios

### References

- [Using FastAPI Framework with Azure Functions](https://learn.microsoft.com/en-us/samples/azure-samples/fastapi-on-azure-functions/fastapi-on-azure-functions/)
- [Azure IoT Hub Messaging](scenarios/1_azure_iot_hub_messaging)
26 changes: 26 additions & 0 deletions docs/scenarios/1_azure_iot_hub_messaging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# References

## Azure Functions

Run the function app locally

```shell
# Run the function app locally with the Azure Functions Core Tools
$ poetry run func start
```

Deploy the function app to Azure

```shell
# Deploy resources to Azure
$ bash scripts/deploy_azure_functions_resources.sh

$ export FUNCTION_APP_NAME="CHANGE_ME"

# Publish the function app to Azure
$ bash scripts/publish_azure_functions.sh
```

### References

- [Using FastAPI Framework with Azure Functions](https://learn.microsoft.com/en-us/samples/azure-samples/fastapi-on-azure-functions/fastapi-on-azure-functions/)
46 changes: 46 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json
site_name: Workshop for Azure IoT
site_url: ""
repo_url: https://github.com/ks6088ts-labs/workshop-azure-iot
repo_name: ks6088ts-labs/workshop-azure-iot
nav:
- Home: index.md
- Scenarios:
- 1. Azure IoT Hub Messaging: scenarios/1_azure_iot_hub_messaging.md
theme:
name: material
# https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#automatic-light-dark-mode
palette:
# Palette toggle for automatic mode
- media: "(prefers-color-scheme)"
toggle:
icon: material/brightness-auto
name: Switch to light mode

# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode

# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/brightness-4
name: Switch to system preference
icon:
repo: fontawesome/brands/github
language: en
extra:
social:
- icon: fontawesome/brands/linkedin
link: https://www.linkedin.com/in/ks6088ts/
- icon: fontawesome/brands/github
link: https://github.com/ks6088ts
- icon: fontawesome/brands/x-twitter
link: https://x.com/ks6088ts
analytics:
provider: google
property: G-0ZTKFXVQ5K
Loading

0 comments on commit c7d7d43

Please sign in to comment.