Skip to content

Update local tests and CI tests to use az login token or managed iden… #1044

Update local tests and CI tests to use az login token or managed iden…

Update local tests and CI tests to use az login token or managed iden… #1044

Workflow file for this run

name: Publish docs site
on:
push:
branches:
- main
paths:
- "docs/**"
jobs:
deploy-site:
runs-on: ubuntu-latest
permissions:
packages: read
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # required to access tags
submodules: "true"
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v2.1.0 # pinned version
with:
registry: docker.pkg.github.com # ghcr.io not yet enabled for Azure org
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build devcontainer image
# We must issue a manual pull before the build so the image gets copied locally, because
# docker.pkg.github.com is not a valid Docker registry and doesn't work with --cache-from,
# however, `docker pull` will fall back to other methods that do work and get the image loaded.
#
# This message comes from "docker pull":
#
# Run docker pull docker.pkg.github.com/azure/azure-service-operator/aso-devcontainer:latest
# WARNING: ⚠️ Failed to pull manifest by the resolved digest. This registry does not
# appear to conform to the distribution registry specification; falling back to
# pull by tag. This fallback is DEPRECATED, and will be removed in a future
# release. Please contact admins of https://docker.pkg.github.com. ⚠️
#
# See: https://github.com/moby/moby/issues/41687#issuecomment-733826074 and related issues
run: |
docker pull docker.pkg.github.com/azure/azure-service-operator/aso-devcontainer:latest
docker build --cache-from docker.pkg.github.com/azure/azure-service-operator/aso-devcontainer:latest --tag devcontainer:latest .devcontainer
env:
DOCKER_BUILDKIT: 1
- name: Run devcontainer image
id: devcontainer
run: |
container_id=$(docker create -w /workspace -v $GITHUB_WORKSPACE:/workspace -v /var/run/docker.sock:/var/run/docker.sock devcontainer:latest)
docker start "$container_id"
echo "container_id=$container_id" >> $GITHUB_ENV
- name: Build & validate docs site
run: |
container_id=${{ env.container_id }}
docker exec "$container_id" task build-docs-site
- name: Publish to gh-pages branch
uses: JamesIves/github-pages-deploy-action@v4.4.1 # pinned version
with:
branch: gh-pages
token: ${{ secrets.GH_PAT }}
folder: docs/hugo/public