feat: update theme #9887
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: Deploy Pages | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- feat/fleek | |
schedule: | |
- cron: "* */1 * * *" # every one hour | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
# Pulls the output.json from the latest successful run of the gateway-conformance.yml workflow | |
# and stores these as an artifacts for the build job. | |
pull-outputs: | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
target: ["ipfs/kubo", "ipfs/boxo", "ipfs/bifrost-gateway"] | |
fail-fast: false | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: get repo details | |
id: get-details | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
OWNER_AND_REPO: ${{ matrix.target }} | |
run: | | |
DETAILS=$(gh api repos/${OWNER_AND_REPO}) | |
DEFAULT_BRANCH=$(echo $DETAILS | jq -r '.default_branch') | |
echo "default-branch=${DEFAULT_BRANCH}" >> $GITHUB_OUTPUT | |
NAME=$(echo $DETAILS | jq -r '.name') | |
echo "name=${NAME}" >> $GITHUB_OUTPUT | |
- name: Download json output | |
id: download-artifact | |
uses: dawidd6/action-download-artifact@v2 # TODO: pin | |
with: | |
workflow: gateway-conformance.yml | |
workflow_conclusion: "completed" # TODO: ideally we could request success|failure (https://github.com/dawidd6/action-download-artifact#usage) | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ steps.get-details.outputs.default-branch }} | |
name: gateway-conformance.json | |
repo: ${{ matrix.target }} | |
if_no_artifact_found: fail | |
- name: Upload JSON output | |
if: (failure() || success()) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: conformance-${{ steps.get-details.outputs.name }}.json | |
path: ./output.json | |
# https://github.com/actions/starter-workflows/blob/4a8f18e34dd13d2b6ee4d8da2ba72629eafe1609/pages/hugo.yml#L1 | |
build: | |
runs-on: ubuntu-latest | |
env: | |
HUGO_VERSION: 0.117.0 | |
permissions: | |
contents: write | |
needs: [pull-outputs] | |
steps: | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@16361eb4acea8698b220b76c0d4e84e1fd22c61d # v2.6.0 | |
with: | |
hugo-version: ${{ env.HUGO_VERSION }} | |
extended: true | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Pages | |
id: pages | |
uses: actions/configure-pages@v1 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- name: Generate Data Aggregates | |
working-directory: ./ | |
run: | | |
npm ci | |
mkdir ./munged | |
# download-artifact downloads artifacts in a directory named after the artifact | |
# details: https://github.com/actions/download-artifact#download-all-artifacts | |
for folder in ./artifacts/conformance-*.json; do | |
file="${folder}/output.json" | |
new_file="./munged/${folder#.\/artifacts\/conformance-}" # drop the ./artifacts/conformance- prefix | |
cat "$file" | node ./munge.js > "${new_file}" | |
done | |
# generate the sqlite database from our munged files | |
node ./munge_sql.js ./aggregates.db ./munged/*.json | |
- name: Upload Data Aggregates | |
# will be very useful for local debugging | |
if: (failure() || success()) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dashboard-aggregates | |
path: | | |
./munged | |
./aggregates.db | |
- name: Generate Content | |
run: | | |
node ./munge_aggregates.js ./aggregates.db ./www | |
- name: Build with Hugo | |
run: | | |
hugo \ | |
--minify \ | |
--baseURL ${{ steps.pages.outputs.base_url }} | |
working-directory: www | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: ./www/public | |
- name: Configure git | |
run: | | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com>" | |
git config --global user.name "${GITHUB_ACTOR}" | |
- name: Push | |
run: | | |
git add -f ./www/public | |
git commit -m "chore: update public site" | |
git push -f origin HEAD:fleek-deploy | |
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 |