forked from vagrant-libvirt/vagrant-libvirt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
- Loading branch information
Showing
65 changed files
with
3,839 additions
and
2,162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "bundler" | ||
directory: "/docs" | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
.github/workflows/publish-documentation-preview-notify.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Deploy Docs Preview Requires Label | ||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronized | ||
paths: | ||
- 'docs/**' | ||
|
||
permissions: | ||
pull-requests: write | ||
jobs: | ||
notify-label-required: | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'preview-docs') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Comment on label required for docs preview deploy | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
recreate: true | ||
header: notify-label-required | ||
message: |- | ||
Maintainers: This PR updates the documentation, please review and apply | ||
the label 'preview-docs' if satisfied it is safe to publish. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Deploy Docs Preview | ||
on: | ||
pull_request_target: | ||
types: | ||
- closed | ||
- labeled | ||
paths: | ||
- 'docs/**' | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
jobs: | ||
build-and-deploy: | ||
if: ${{ github.event.action == 'closed' || (github.event.action == 'labeled' && github.event.label.name == 'preview-docs') }} | ||
concurrency: publish-gh-pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Set up Ruby | ||
if: ${{ github.event.action == 'labeled' }} | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.6 | ||
- name: Install and Build 🔧 | ||
# don't allow a close to execute anything from the source code | ||
if: ${{ github.event.action == 'labeled' }} | ||
run: | | ||
PR_NUMBER=$(jq -r ".number" "$GITHUB_EVENT_PATH") | ||
REPO_NAME=$(jq -r ".repository.name" "$GITHUB_EVENT_PATH") | ||
# TODO find a way for jekyll to perform this automatically | ||
convert docs/_assets/images/logo.png -define icon:auto-resize=256,64,48,32,16 docs/favicon.ico | ||
# avoid look up of API as it doesn't work from within actions without exposing the GITHUB_TOKEN here which is a security risk | ||
cat <<EOF >> docs/_config.yml | ||
repository_nwo: vagrant-libvirt/vagrant-libvirt | ||
plugin_script_base_path: /${REPO_NAME}/pr-preview/pr-${PR_NUMBER} | ||
EOF | ||
BUNDLE_GEMFILE=./docs/Gemfile bundle install | ||
BUNDLE_GEMFILE=./docs/Gemfile bundle exec jekyll build --source docs/ --baseurl="/${REPO_NAME}/pr-preview/pr-${PR_NUMBER}" --destination build | ||
- name: Set action | ||
run: | | ||
event_type=$(jq -r ".action" "$GITHUB_EVENT_PATH") | ||
echo "event_type is $event_type" | ||
case $event_type in | ||
"labeled") | ||
echo "action set to deploy" | ||
echo "action=deploy" >> "$GITHUB_ENV" | ||
;; | ||
"closed") | ||
echo "action set to remove" | ||
echo "action=remove" >> "$GITHUB_ENV" | ||
;; | ||
*) | ||
echo "unknown event type $event_type; no action to take" | ||
echo "action=none" >> "$GITHUB_ENV" | ||
;; | ||
esac | ||
- name: Deploy preview | ||
uses: rossjrw/pr-preview-action@v1 | ||
with: | ||
action: ${{ env.action }} | ||
source-dir: ./build/ | ||
preview-branch: gh-pages | ||
umbrella-dir: pr-preview | ||
- name: Remove label | ||
uses: actions-ecosystem/action-remove-labels@v1 | ||
if: ${{ always() }} | ||
with: | ||
labels: preview-docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Deploy Docs Release | ||
on: | ||
push: | ||
tags: | ||
- '*.*.*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build-and-deploy: | ||
concurrency: ci-${{ github.ref }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.6 | ||
- name: Install and Build 🔧 | ||
run: | | ||
VERSION={{ github.ref_name }} | ||
REPO_NAME=$(jq -r ".repository.name" "$GITHUB_EVENT_PATH") | ||
# TODO find a way for jekyll to perform this automatically | ||
convert docs/_assets/images/logo.png -define icon:auto-resize=256,64,48,32,16 docs/favicon.ico | ||
# avoid look up of API as it doesn't work from within actions without exposing the GITHUB_TOKEN here which is a security risk | ||
cat <<EOF >> docs/_config.yml | ||
repository_nwo: vagrant-libvirt/vagrant-libvirt | ||
EOF | ||
BUNDLE_GEMFILE=./docs/Gemfile bundle install | ||
BUNDLE_GEMFILE=./docs/Gemfile bundle exec jekyll build --source docs/ --baseurl="/${REPO_NAME}/version/${VERSION}" --destination build | ||
- name: Deploy 🚀 | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages | ||
folder: build | ||
clean: true | ||
force: false | ||
target-folder: version/{{ github.ref_name }} | ||
clean-exclude: | | ||
pr-preview/ | ||
version/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Deploy Docs | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'docs/**' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build-and-deploy: | ||
concurrency: ci-${{ github.ref }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.6 | ||
- name: Install and Build 🔧 | ||
run: | | ||
# TODO find a way for jekyll to perform this automatically | ||
convert docs/_assets/images/logo.png -define icon:auto-resize=256,64,48,32,16 docs/favicon.ico | ||
# avoid look up of API as it doesn't work from within actions without exposing the GITHUB_TOKEN here which is a security risk | ||
cat <<EOF >> docs/_config.yml | ||
repository_nwo: vagrant-libvirt/vagrant-libvirt | ||
EOF | ||
BUNDLE_GEMFILE=./docs/Gemfile bundle install | ||
BUNDLE_GEMFILE=./docs/Gemfile bundle exec jekyll build --source docs/ --destination build | ||
- name: Deploy 🚀 | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages | ||
folder: build | ||
clean: true | ||
clean-exclude: | | ||
pr-preview/ | ||
version/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ tmp | |
.vagrant | ||
*.swp | ||
.deps | ||
docs/favicon.ico | ||
|
||
# don't commit the generated version | ||
lib/vagrant-libvirt/version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.