mirror of
https://github.com/apple/container.git
synced 2026-09-22 15:45:38 +00:00
Publish docs github action (#9)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
This commit is contained in:
@@ -18,3 +18,4 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
pages: write
|
||||
|
||||
@@ -38,19 +38,19 @@ jobs:
|
||||
# TODO [launch]: TEMPORARILY we need to exclude these files since we had to modify them to add
|
||||
# the github token for pulling the private repos.
|
||||
if ! git diff --quiet -- . ':(exclude)Package.swift' ':(exclude)Package.resolved' ':(exclude)Protobuf.Makefile'; then echo "The following files require formatting or license header updates:\n$(git diff --name-only)" ; false ; fi
|
||||
|
||||
env:
|
||||
CURRENT_SDK: y
|
||||
CONTAINERIZATION_REPO: https://${{ secrets.REPO_READ }}@github.com/apple/containerization.git
|
||||
CONTAINERIZATION_REPO: https://${{ secrets.REPO_READ }}@github.com/apple/containerization.git
|
||||
- name: Set build configuration
|
||||
run: |
|
||||
echo "BUILD_CONFIGURATION=debug" >> $GITHUB_ENV
|
||||
if [ ${{ inputs.release }} == true ]; then
|
||||
echo "BUILD_CONFIGURATION=release" >> $GITHUB_ENV
|
||||
fi
|
||||
- name: Make the container project
|
||||
- name: Make the container project and docs
|
||||
run: |
|
||||
make container dsym
|
||||
make container dsym docs
|
||||
tar cfz _site.tgz _site
|
||||
env:
|
||||
DEVELOPER_DIR: "/Applications/Xcode_16.3.app/Contents/Developer"
|
||||
CURRENT_SDK: y
|
||||
@@ -71,8 +71,35 @@ jobs:
|
||||
DEVELOPER_DIR: "/Applications/Xcode_16.3.app/Contents/Developer"
|
||||
CURRENT_SDK: y
|
||||
CONTAINERIZATION_REPO: https://${{ secrets.REPO_READ }}@github.com/apple/containerization.git
|
||||
- name: Save artifacts
|
||||
- name: Save documentation artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: api-docs
|
||||
path: "./_site.tgz"
|
||||
retention-days: 14
|
||||
- name: Save package artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: container-package
|
||||
path: ${{ github.workspace }}/outputs
|
||||
uploadPages:
|
||||
# Separate upload step required because upload-pages-artifact needs
|
||||
# gtar which is not on the macOS runner.
|
||||
name: Upload artifact for GitHub Pages
|
||||
needs: buildAndTest
|
||||
timeout-minutes: 5
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v5
|
||||
- name: Download a single artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: api-docs
|
||||
- name: Add API docs to documentation
|
||||
run: |
|
||||
tar xfz _site.tgz
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: "./_site"
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
# Manual workflow for releasing docs ad-hoc. Workflow can only be run for main or release branches.
|
||||
# Workflow does NOT publish a release of container.
|
||||
name: Deploy application website
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
checkBranch:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'ref/heads/release')
|
||||
steps:
|
||||
- name: Branch validation
|
||||
run: echo "Branch ${{ github.ref_name }} is allowed"
|
||||
|
||||
buildSite:
|
||||
name: Build application website
|
||||
needs: checkBranch
|
||||
uses: ./.github/workflows/common.yml
|
||||
secrets: inherit
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
pages: write
|
||||
|
||||
deployDocs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [checkBranch, buildSite]
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
@@ -15,6 +15,7 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
pages: write
|
||||
release:
|
||||
name: Publish release
|
||||
timeout-minutes: 30
|
||||
@@ -23,6 +24,7 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
packages: read
|
||||
pages: write
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
Reference in New Issue
Block a user