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: Build and Deploy docs.rockylinux.org | |
concurrency: | |
group: production | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
repository_dispatch: | |
types: [deploy] | |
jobs: | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
container: | |
image: quay.io/rockylinux/rockylinux:9 | |
options: --user root | |
outputs: | |
DOCS_SHA: ${{steps.docs-sha.outputs.DOCS_SHA}} | |
environment: production | |
steps: | |
- name: Checkout mkdocs config | |
uses: actions/checkout@v4 | |
- name: "Build Site" | |
uses: ./.github/actions/build-and-cache/ | |
- name: set docs-sha | |
id: docs-sha | |
run: echo "DOCS_SHA=$DOCS_SHA" >> "$GITHUB_OUTPUT" | |
deploy: | |
name: deploy | |
needs: build | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
node-version: 20 | |
# needs node | |
- uses: actions/cache@v4 | |
id: docs-cache | |
with: | |
path: build/site/minified | |
key: cache-docs-${{ needs.build.outputs.DOCS_SHA }} | |
fail-on-cache-miss: false | |
enableCrossOsArchive: true | |
- name: Retrieve build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-minified | |
path: | | |
build/minified/site | |
- name: Set up Fastly CLI | |
uses: fastly/compute-actions/setup@v6 | |
with: | |
cli_version: 'latest' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Dependencies | |
run: npm install | |
working-directory: ./compute-js | |
- name: restore cached fastly compute package | |
id: restore-fastly-cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
pkg/*.tar.gz | |
key: cache-fastly-${{ steps.docs-sha.outputs.DOCS_SHA }} | |
- name: Build Compute Package | |
if: steps.restore-fastly-cache.outputs.cache-hit != 'true' | |
uses: fastly/compute-actions/build@v6 | |
with: | |
verbose: false | |
project_directory: compute-js | |
env: | |
FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }} | |
- name: Upload fastly compute package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-fastly-wasm | |
path: | | |
pkg/*.tar.gz | |
- name: cache fastly compute package | |
id: cache-fastly | |
uses: actions/cache@v4 | |
with: | |
path: | | |
pkg/*.tar.gz | |
key: cache-fastly-${{ steps.docs-sha.outputs.DOCS_SHA }} | |
- name: Deploy Compute Package | |
uses: fastly/compute-actions/deploy@v6 | |
with: | |
comment: 'Deployed via GitHub Actions' | |
project_directory: compute-js | |
env: | |
FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }} |