Repository navigation
Add installation chunks back #11
This file contains hidden or 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: biocbook | |
| on: | |
| push: | |
| branches: | |
| - devel | |
| - RELEASE_** | |
| jobs: | |
| build-push: | |
| runs-on: ubuntu-latest | |
| name: build-book (${{ github.ref_name }}) | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - name: 🧾 Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: ⏳ Collect Workflow Telemetry | |
| uses: runforesight/workflow-telemetry-action@v1 | |
| - name: 🧹 Clean up Docker environment | |
| run: | | |
| docker system prune --all --force --volumes | |
| - name: 🧹 Additional disk space cleanup | |
| run: | | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /usr/local/lib/android/sdk | |
| sudo apt-get clean | |
| sudo rm -rf /var/lib/apt/lists/* | |
| - name: 🐳 Set up QEMU | |
| uses: docker/setup-qemu-action@v2 | |
| - name: 🐳 Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: 📦 Cache Docker layers | |
| uses: actions/cache@v3 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: ${{ runner.os }}-buildx-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-buildx- | |
| - name: 📝 Get book info | |
| id: info | |
| env: | |
| OWNER: ${{ github.repository_owner }} | |
| run: | | |
| Pkgname=$(grep -m1 -E '^Package: +' DESCRIPTION | sed -E 's/.*: +//') | |
| echo Pkgname=${Pkgname} >> "${GITHUB_ENV}" | |
| pkgname=${Pkgname,,} | |
| echo pkgname=${pkgname} >> "${GITHUB_ENV}" | |
| owner=${OWNER,,} | |
| echo owner=${owner} >> "${GITHUB_ENV}" | |
| echo pkgversion=$(grep -m1 -E '^Version: +' DESCRIPTION | sed -E 's/.*: +//') >> "${GITHUB_ENV}" | |
| - name: 🔐 Log in to the Github Container registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ env.owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: 🏷 Get metadata for Docker | |
| id: meta | |
| uses: docker/metadata-action@v4 | |
| with: | |
| images: ghcr.io/${{ env.owner }}/${{ env.pkgname }} | |
| tags: | | |
| ${{ github.ref_name }} | |
| ${{ env.pkgversion }} | |
| type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'devel') }} | |
| - name: 🐳 Build and push Docker image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| push: true | |
| cache-from: type=local,src=/tmp/.buildx-cache | |
| cache-to: type=local,dest=/tmp/.buildx-cache | |
| tags: ${{ steps.meta.outputs.tags }} | |
| build-args: | | |
| BIOC_VERSION=${{ github.ref_name }} | |
| - name: 📚 Run container and copy artifacts | |
| env: | |
| IMAGE: ghcr.io/${{ env.owner }}/${{ env.pkgname }}:${{ github.ref_name }} | |
| run: | | |
| mkdir -p out | |
| docker run --rm -v $PWD/out:/out $IMAGE \ | |
| sh -c "tar -xzvf /${{ env.Pkgname }}_${{ env.pkgversion }}.tar.gz -C / && cp -r /${{ env.Pkgname }}/inst/doc/book /out/" | |
| echo bundle_path=out/${{ env.Pkgname }}_${{ env.pkgversion }}.tar.gz >> "${GITHUB_ENV}" | |
| echo book_path=out/book >> "${GITHUB_ENV}" | |
| - name: 🏷 Get gh-branch directory to deploy to | |
| run: | | |
| echo target_folder=$(echo ${{ github.ref_name }} | sed 's,RELEASE_,,' | tr '_' '.') >> "${GITHUB_ENV}" | |
| - name: 🚀 Deploy book to Github Pages on versioned branch | |
| uses: JamesIves/github-pages-deploy-action@v4.4.3 | |
| with: | |
| folder: ${{ env.book_path }}/ | |
| target-folder: docs/${{ env.target_folder }}/ | |
| branch: gh-pages | |
| clean: false | |
| - name: 💾 Upload package bundle artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bundle | |
| path: ${{ env.bundle_path }} | |
| - name: 💾 Upload book artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: book | |
| path: ${{ env.book_path }} |