Fix command to generate Puppetserver CA certs for load balancer (#3398) #17556
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
--- | |
name: deploy | |
on: | |
push: | |
branches: | |
- master | |
- "[0-9]+.[0-9]+" | |
pull_request: | |
branches: | |
- master | |
- "[0-9]+.[0-9]+" | |
env: | |
RUBY_VERSION: 3.1 | |
BUNDLE_WITHOUT: "nanoc" | |
MAKE_J: 3 | |
jobs: | |
build-ccutil: | |
runs-on: ubuntu-22.04 | |
container: | |
image: quay.io/ivanhorvath/ccutil:amazing | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Compile html-single | |
run: | | |
for DIR in guides/doc-*; do | |
pushd $DIR &>/dev/null | |
[[ -d images/ ]] || (echo "Required images/ directory missing in $DIR"; exit 1) | |
[[ -h images/common ]] || (echo "Required images/common symlink missing in $DIR"; exit 1) | |
if [[ -f docinfo.xml ]]; then | |
echo "Running ccutil in $DIR" | |
sed -i "1 i:build: satellite\n" master.adoc | |
ccutil compile --lang=en-US --format html-single | |
else | |
echo "Skipping ccutil in $DIR (no docinfo.xml)" | |
fi | |
popd &>/dev/null | |
done | |
build-html: | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
shell: bash | |
working-directory: guides | |
steps: | |
- name: Get branch name (merge) | |
if: github.event_name != 'pull_request' | |
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV | |
working-directory: . | |
- name: Get branch name (pull request) | |
if: github.event_name == 'pull_request' | |
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV | |
working-directory: . | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ env.RUBY_VERSION }} | |
bundler-cache: true | |
- name: Build HTML with real links | |
run: | | |
make clean | |
make -j ${{ env.MAKE_J }} html BUILD=foreman-el | |
make -j ${{ env.MAKE_J }} html BUILD=foreman-deb | |
make -j ${{ env.MAKE_J }} html BUILD=katello | |
make -j ${{ env.MAKE_J }} html BUILD=satellite | |
make -j ${{ env.MAKE_J }} html BUILD=orcharhino | |
- name: Upload HTML | |
uses: actions/upload-artifact@v3 | |
with: | |
name: foreman-docs-html-${{ env.BRANCH_NAME }} | |
path: guides/build/ | |
pr-metadata: | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'pull_request' | |
steps: | |
- name: Get branch name (pull request) | |
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV | |
- name: Set target name (master) | |
if: github.base_ref == 'master' | |
run: echo "TARGET_NAME=nightly" >> $GITHUB_ENV | |
- name: Set target name (stable branch) | |
if: github.base_ref != 'master' | |
run: echo "TARGET_NAME=$(echo ${GITHUB_BASE_REF} | tr / -)" >> $GITHUB_ENV | |
- name: Save PR metadata | |
run: | | |
mkdir -p ./pr | |
echo '{"pr_number": ${{ github.event.number }}, "branch_name": "${{ env.BRANCH_NAME }}", "target_name": "${{ env.TARGET_NAME }}", "head_sha": "${{ github.event.pull_request.head.sha }}"}' > ./pr/pr.json | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: pr | |
path: ./pr/ | |
build-html-base: | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'pull_request' | |
defaults: | |
run: | |
shell: bash | |
working-directory: guides | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.base_ref }} | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ env.RUBY_VERSION }} | |
bundler-cache: true | |
- name: Build HTML base for comparison | |
run: | | |
make clean | |
make -j ${{ env.MAKE_J }} html BUILD=foreman-el | |
make -j ${{ env.MAKE_J }} html BUILD=foreman-deb | |
make -j ${{ env.MAKE_J }} html BUILD=katello | |
make -j ${{ env.MAKE_J }} html BUILD=satellite | |
make -j ${{ env.MAKE_J }} html BUILD=orcharhino | |
- name: Upload HTML base for comparison | |
uses: actions/upload-artifact@v3 | |
with: | |
name: foreman-docs-html-base | |
path: guides/build/ | |
build-pdf: | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
shell: bash | |
working-directory: guides | |
steps: | |
- name: Get branch name (merge) | |
if: github.event_name != 'pull_request' | |
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV | |
working-directory: . | |
- name: Get branch name (pull request) | |
if: github.event_name == 'pull_request' | |
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV | |
working-directory: . | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ env.RUBY_VERSION }} | |
bundler-cache: true | |
- name: Clean the environment | |
run: make clean | |
- name: Build PDFs (master/stable) | |
run: | | |
make -j ${{ env.MAKE_J }} pdf BUILD=foreman-el | |
- name: Build PDFs (PR) | |
if: > | |
github.repository_owner == 'theforeman' && | |
(github.ref == 'refs/heads/master' || | |
startsWith(github.ref, 'refs/heads/2.') || | |
startsWith(github.ref, 'refs/heads/3.')) | |
run: | | |
make -j ${{ env.MAKE_J }} pdf BUILD=foreman-deb | |
make -j ${{ env.MAKE_J }} pdf BUILD=katello | |
make -j ${{ env.MAKE_J }} pdf BUILD=satellite | |
make -j ${{ env.MAKE_J }} pdf BUILD=orcharhino | |
- name: Upload PDFs | |
uses: actions/upload-artifact@v3 | |
with: | |
name: foreman-docs-pdf-${{ env.BRANCH_NAME }} | |
path: guides/build/*.pdf | |
build-web: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: master | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ env.RUBY_VERSION }} | |
bundler-cache: true | |
working-directory: ./web | |
- name: Build site with nanoc | |
run: bundle exec nanoc | |
working-directory: ./web | |
- name: Upload web | |
uses: actions/upload-artifact@v3 | |
with: | |
name: foreman-docs-web-master | |
path: web/output/ | |
publish: | |
if: > | |
github.repository_owner == 'theforeman' && | |
(github.ref == 'refs/heads/master' || | |
startsWith(github.ref, 'refs/heads/2.') || | |
startsWith(github.ref, 'refs/heads/3.')) | |
needs: | |
- build-html | |
- build-web | |
- build-ccutil | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Get branch name (merge) | |
if: github.event_name != 'pull_request' | |
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV | |
- name: Get branch name (pull request) | |
if: github.event_name == 'pull_request' | |
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV | |
- name: Create public directory | |
run: mkdir -p public/${{ env.BRANCH_NAME }} | |
- name: Download web (only for master) | |
if: github.ref == 'refs/heads/master' | |
uses: actions/download-artifact@v3 | |
with: | |
name: foreman-docs-web-${{ env.BRANCH_NAME }} | |
path: public | |
- name: Download HTML | |
uses: actions/download-artifact@v3 | |
with: | |
name: foreman-docs-html-${{ env.BRANCH_NAME }} | |
path: public/${{ env.BRANCH_NAME }} | |
- name: Rename master to nightly | |
if: github.ref == 'refs/heads/master' | |
run: mv master nightly | |
working-directory: ./public | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public | |
keep_files: true |