File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,6 +172,41 @@ jobs:
172172 path : docs/build/html
173173 if-no-files-found : error
174174
175+ # This build step publishes a package as a container
176+ # Thanks to https://www.kenmuse.com/blog/universal-packages-on-github-with-oras/
177+ # Download the resulting package built for master using:
178+ # oras pull ghcr.io/linuxcnc/linuxcnc/doc-html:master
179+ htmldocs-package :
180+ runs-on : ubuntu-24.04
181+ needs : htmldocs
182+ # Run on branch master / 2.9 or if the commit is tagged
183+ if : github.ref_name == 'master' || github.ref_name == '2.9' || startsWith(github.ref, 'refs/tags/')
184+ permissions :
185+ packages : write # to create containers
186+ steps :
187+ - name : Dump GitHub context
188+ env :
189+ GITHUB_CONTEXT : ${{ toJson(github) }}
190+ run : |
191+ echo Number of CPUs: $(nproc)
192+ echo "$GITHUB_CONTEXT"
193+ - name : Download artifacts
194+ uses : actions/download-artifact@v8
195+ with :
196+ name : linuxcnc-doc
197+ path : html
198+ - name : Use oras
199+ uses : oras-project/setup-oras@v2
200+ with :
201+ version : 1.3.1
202+ - name : Publish package
203+ run : |
204+ set -x
205+ tar -czf doc-html.tar.gz html
206+ TAG=${{github.ref_name}} #This is either the tag or branch name
207+ echo ${{ secrets.GITHUB_TOKEN }} | oras login --username ${{ github.actor }} --password-stdin ghcr.io
208+ oras push ghcr.io/${{ github.repository_owner }}/linuxcnc/doc-html:${TAG} --artifact-type application/vnd.pkgw doc-html.tar.gz
209+
175210 package-arch :
176211 runs-on : ${{ matrix.runner }}
177212 strategy :
You can’t perform that action at this time.
0 commit comments