Skip to content

Update README.md #26

Update README.md

Update README.md #26

Workflow file for this run

# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0.28
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: test
MYSQL_USER: test
MYSQL_PASSWORD: password
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Install pandoc
run: sudo apt-get update && sudo apt-get install -y pandoc
- name: Execute SQL script to create tables
run: mysql --protocol=tcp -uroot -h localhost -P 3306 -ppassword test --default-character-set=utf8mb4 < example.sql
- name: Generate HTML and CSS
run: |
rm -rf ./dist
mkdir -p ./dist
CSS_URL="https://raw.githubusercontent.com/sindresorhus/github-markdown-css/gh-pages/github-markdown.css"
CSS_CONTENT=$(curl -s "$CSS_URL" | sed 's/\.markdown-//g')
HTML_CONTENT=$(go run main.go --host localhost --password password --port 3306 --user test --database test | pandoc -f gfm)
echo "<style>$CSS_CONTENT</style>$HTML_CONTENT" > ./dist/index.html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4