Publish to GitHub Pages #1238
This file contains 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 to GitHub Pages | |
on: | |
push: | |
branches: ["gh-pages"] | |
workflow_dispatch: | |
schedule: | |
# Run Daily at 9:00 AM UTC | |
# Pick up updates to crawled Features | |
- cron: '0 9 * * *' | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
# Build job | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Oras | |
run: | | |
curl -LO https://github.com/oras-project/oras/releases/download/v0.13.0/oras_0.13.0_linux_amd64.tar.gz | |
mkdir -p oras-install/ | |
tar -zxf oras_0.13.0_*.tar.gz -C oras-install/ | |
mv oras-install/oras /usr/local/bin/ | |
rm -rf oras_0.13.0_*.tar.gz oras-install/ | |
- name: Fetch devcontainer-control-manifest.json | |
run: | | |
cd _data | |
oras pull ghcr.io/devcontainers/control-manifest:latest | |
cp devcontainer-control-manifest.json ../static/ | |
- name: Fetch devcontainer-index.json | |
run: | | |
cd _data | |
oras pull ghcr.io/devcontainers/index:latest | |
cp devcontainer-index.json ../static/ | |
- name: Setup Pages | |
uses: actions/configure-pages@v1 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./ | |
destination: ./_site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
# Deployment job | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |