feat(actions): Add actions to publish docs #1
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: Publish GitHub Pages | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
build-devcontainer: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout (GitHub) | |
uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push devcontainer image | |
uses: devcontainers/[email protected] | |
with: | |
imageName: ghcr.io/lf-certification/cert-tech-docs-devcontainer | |
cacheFrom: ghcr.io/lf-certification/cert-tech-docs-devcontainer | |
push: always | |
publish-gh-pages: | |
needs: [build-devcontainer] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout (GitHub) | |
uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run devcontainer task | |
uses: devcontainers/[email protected] | |
with: | |
imageName: ghcr.io/lf-certification/cert-tech-docs-devcontainer | |
cacheFrom: ghcr.io/lf-certification/cert-tech-docs-devcontainer | |
push: never | |
runCmd: | | |
set -e | |
poetry run mkdocs gh-deploy --force --no-history \ | |
--remote-branch gh-pages |