From b829221cc4ea0c37569472795ccafb31fc30da05 Mon Sep 17 00:00:00 2001 From: peaceiris <30958501+peaceiris@users.noreply.github.com> Date: Fri, 26 Apr 2019 06:17:16 +0900 Subject: [PATCH] replace: GitHub Actions --- .github/mkdocs/Dockerfile | 17 ----------- .github/mkdocs/README.md | 33 --------------------- .github/mkdocs/entrypoint.sh | 25 ---------------- README.md | 2 ++ docs/hosting-and-deployment/github-pages.md | 22 +------------- 5 files changed, 3 insertions(+), 96 deletions(-) delete mode 100644 .github/mkdocs/Dockerfile delete mode 100644 .github/mkdocs/README.md delete mode 100755 .github/mkdocs/entrypoint.sh diff --git a/.github/mkdocs/Dockerfile b/.github/mkdocs/Dockerfile deleted file mode 100644 index 5796aec8..00000000 --- a/.github/mkdocs/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM peaceiris/mkdocs-material:latest - -LABEL "com.github.actions.name"="Material for MkDocs build and deploy to GitHub Pages" -LABEL "com.github.actions.description"="Build documentation with Material for MkDocs and push to GitHub Pages." -LABEL "com.github.actions.icon"="upload-cloud" -LABEL "com.github.actions.color"="blue" - -LABEL "repository"="https://github.com/peaceiris/mkdocs-material-boilerplate" -LABEL "homepage"="https://github.com/peaceiris/mkdocs-material-boilerplate" -LABEL "maintainer"="peaceiris" - -RUN apk add --no-cache \ - git \ - openssh-client - -ADD entrypoint.sh /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/mkdocs/README.md b/.github/mkdocs/README.md deleted file mode 100644 index 5e7e624b..00000000 --- a/.github/mkdocs/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# GitHub Actions for MkDocs and GitHub Pages - -Build markdown documentation with [Material for MkDocs] and push to GitHub Pages with GitHub Actions. - -[Material for MkDocs]: https://github.com/squidfunk/mkdocs-material - -![material.png](https://raw.githubusercontent.com/peaceiris/mkdocs-material-boilerplate/master/docs/images/material.png) - - - -## Sample repository - -[peaceiris/mkdocs-material-boilerplate: MkDocs Material Boilerplate (Starter Kit)] - -> Deploy documentation to hosting platforms (Netlify, GitHub Pages, GitLab Pages, and AWS Amplify Console) with CircleCI, Docker, pipenv, GitHub Actions - -[peaceiris/mkdocs-material-boilerplate: MkDocs Material Boilerplate (Starter Kit)]: https://github.com/peaceiris/mkdocs-material-boilerplate - - - -## Getting started - -- [Build and deploy with GitHub Actions - MkDocs Material Boilerplate] - -[Build and deploy with GitHub Actions - MkDocs Material Boilerplate]: https://peaceiris.github.io/mkdocs-material-boilerplate/hosting-and-deployment/github-pages/#build_and_deploy_with_github_actions - - - -## License - -[MIT License - peaceiris/mkdocs-material-boilerplate] - -[MIT License - peaceiris/mkdocs-material-boilerplate]: https://github.com/peaceiris/mkdocs-material-boilerplate/blob/master/LICENSE diff --git a/.github/mkdocs/entrypoint.sh b/.github/mkdocs/entrypoint.sh deleted file mode 100755 index f2ac65fb..00000000 --- a/.github/mkdocs/entrypoint.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -# Fail on unset variables and command errors -set -ex -o pipefail # -x: is for debugging - -mkdir /root/.ssh -ssh-keyscan -t rsa github.com > /root/.ssh/known_hosts -echo "${ACTIONS_DEPLOY_KEY}" > /root/.ssh/id_rsa -chmod 400 /root/.ssh/id_rsa - -mkdocs build - -remote_repo="git@github.com:${GITHUB_REPOSITORY}.git" -remote_branch="gh-pages" - -cd site -git init -git config user.name "${GITHUB_ACTOR}" -git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" -git remote add origin "${remote_repo}" -git checkout "${remote_branch}" || git checkout --orphan "${remote_branch}" -git add --all -timestamp=$(date -u) -git commit -m "Automated deployment: ${timestamp} ${GITHUB_SHA}" -git push origin "${remote_branch}" --force diff --git a/README.md b/README.md index 38449c78..4c551e24 100644 --- a/README.md +++ b/README.md @@ -44,9 +44,11 @@ inv serve - [mkdocs/mkdocs: Project documentation with Markdown - GitHub] - [squidfunk/mkdocs-material: A Material Design theme for MkDocs] +- [peaceiris/actions-mkdocs-gh-pages: GitHub Actions for MkDocs and GitHub Pages] [mkdocs/mkdocs: Project documentation with Markdown - GitHub]: https://github.com/mkdocs/mkdocs/ [squidfunk/mkdocs-material: A Material Design theme for MkDocs]: https://github.com/squidfunk/mkdocs-material +[peaceiris/actions-mkdocs-gh-pages: GitHub Actions for MkDocs and GitHub Pages]: https://github.com/peaceiris/actions-mkdocs-gh-pages diff --git a/docs/hosting-and-deployment/github-pages.md b/docs/hosting-and-deployment/github-pages.md index ed7197ce..3718569e 100644 --- a/docs/hosting-and-deployment/github-pages.md +++ b/docs/hosting-and-deployment/github-pages.md @@ -6,27 +6,7 @@ ## Build and deploy with GitHub Actions -### (1) Add deploy Key - -1. Generate deploy key `ssh-keygen -t rsa -f mkdocs -q -N ""` -2. Go to "Settings > Deploy Keys" of repository. -3. Add your public key within "Allow write access" option. -4. Go to "Settings > Secrets" of repository. -5. Add your private deploy key as `ACTIONS_DEPLOY_KEY` - -### (2) Push `.github` - -``` -.github -├── main.workflow -└── mkdocs - ├── Dockerfile - └── entrypoint.sh -``` - -### (3) Update releases - -When you push to master branch, GitHub Actions runs. +- [GitHub Actions for MkDocs and GitHub Pages - Build markdown documentation with Material for MkDocs and push to GitHub Pages with GitHub Actions](https://github.com/peaceiris/actions-mkdocs-gh-pages)