Merge pull request #346 from hellcp-work/fine-grained #87
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-to-obs-landing | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '.github/workflows/**' | |
- '!.github/workflows/deploy-to-obs-landing.yaml' | |
- '.travis.yml' | |
- 'Dockerfile' | |
- 'Dockerfile.base' | |
- 'README.md' | |
- 'docker-compose.override.yml.example' | |
- 'docker-compose.yml' | |
jobs: | |
build-obs-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup SSH Client | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.DEPLOY_KEY_PRIVATE }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.DEPLOY_KEY_PRIVATE }} | |
- name: Checkout obs-landing repo | |
uses: actions/checkout@v4 | |
with: | |
repository: openSUSE/obs-landing | |
path: obs-landing | |
ssh-key: ${{ secrets.DEPLOY_KEY_PRIVATE }} | |
- name: install daps2docker | |
run: | | |
git clone [email protected]:openSUSE/daps2docker.git | |
- name: validate | |
run: | | |
pushd daps2docker | |
for doc in obs-admin-guide obs-user-guide; do | |
source ../DC-$doc || exit 1 | |
./daps2docker.sh ../DC-$doc validate | |
done | |
- name: build html | |
run: | | |
pushd daps2docker | |
for doc in obs-admin-guide obs-user-guide; do | |
source ../DC-$doc || exit 1 | |
./daps2docker.sh ../DC-$doc html || exit 1 | |
rm -rf ../obs-landing/help/manuals/${doc} || exit 1 | |
mv -v /tmp/daps2docker-*/$doc/html/${ROOTID} ../obs-landing/help/manuals/${doc} || exit 1 | |
done | |
- name: build pdf | |
run: | | |
pushd daps2docker | |
for doc in obs-admin-guide obs-user-guide; do | |
source ../DC-$doc || exit 1 | |
./daps2docker.sh ../DC-$doc pdf || exit 1 | |
# update pdf | |
mv -v /tmp/daps2docker-*/$doc/${ROOTID}_en.pdf ../obs-landing/files/manuals/${doc}.pdf || exit 1 | |
done | |
- name: build epub | |
run: | | |
pushd daps2docker | |
for doc in obs-admin-guide obs-user-guide; do | |
source ../DC-$doc || exit 1 | |
./daps2docker.sh ../DC-$doc epub || exit 1 | |
# update epub | |
mv -v /tmp/daps2docker-*/$doc/${ROOTID}_en.epub ../obs-landing/files/manuals/${doc}.epub || exit 1 | |
done | |
- name: Commit files | |
run: | | |
pushd obs-landing | |
git config --local user.email "[email protected]" | |
git config --local user.name "obs-docs-deployment" | |
git add -A | |
git commit -m "Update books to current state" | |
git push |