Merge pull request #71 from rocky-linux/07-29-switch_to_use_fastly_co… #4
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: production | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
repository_dispatch: | |
types: [remote_deploy] | |
jobs: | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
container: | |
image: quay.io/rockylinux/rockylinux:9 | |
options: --user root | |
outputs: | |
DOCS_SHA: ${{steps.build.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" >> "$GITHUB_OUTPUT" | |
deploy: | |
name: deploy | |
needs: build | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- uses: actions/cache/restore@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 | |
if: steps.docs-cache.outputs.cache-hit != 'true' | |
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: Build Compute Package | |
uses: fastly/compute-actions/build@v6 | |
with: | |
verbose: true | |
project_directory: compute-js | |
- 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 }} |