Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
electrofelix committed Aug 16, 2022
2 parents 95a2253 + 77e53a2 commit 80ef40b
Show file tree
Hide file tree
Showing 65 changed files with 3,839 additions and 2,162 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
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"
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
-
name: Login to DockerHub
if: steps.have_credentials.outputs.access == 'true'
uses: docker/login-action@v1
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/publish-documentation-preview-notify.yml
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.
76 changes: 76 additions & 0 deletions .github/workflows/publish-documentation-preview.yml
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
46 changes: 46 additions & 0 deletions .github/workflows/publish-documentation-release.yml
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/
43 changes: 43 additions & 0 deletions .github/workflows/publish-documentation.yml
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/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ tmp
.vagrant
*.swp
.deps
docs/favicon.ico

# don't commit the generated version
lib/vagrant-libvirt/version
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ group :development do
vagrant_gem_version = Gem::Version.new('2.2.8')
end

vagrant_spec_verison = ENV['VAGRANT_SPEC_VERSION']
if !vagrant_spec_verison.nil? && !vagrant_spec_verison.empty?
gem 'vagrant-spec', :git => 'https://github.com/hashicorp/vagrant-spec', :ref => vagrant_spec_verison
vagrant_spec_version = ENV['VAGRANT_SPEC_VERSION']
if !vagrant_spec_version.nil? && !vagrant_spec_version.empty?
gem 'vagrant-spec', :git => 'https://github.com/hashicorp/vagrant-spec', :ref => vagrant_spec_version
elsif vagrant_gem_version <= Gem::Version.new('2.2.7')
gem 'vagrant-spec', :git => 'https://github.com/hashicorp/vagrant-spec', :ref => '161128f2216cee8edb7bcd30da18bd4dea86f98a'
else
Expand Down
Loading

0 comments on commit 80ef40b

Please sign in to comment.