Skip to content

Update internal links (#6549) #605

Update internal links (#6549)

Update internal links (#6549) #605

Workflow file for this run

name: Update Hugo image cache
on:
push:
branches:
- develop
env:
repo_name: docs
repo_owner: linode
hugo_image_cache_name: hugo-generated-images
hugo_image_cache_path: /home/runner/work/docs/docs/docs-repo/resources/_gen/images/
jobs:
cache-images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: docs-repo
- name: Print current docs repo branch/ref/commit
working-directory: ./docs-repo
run: |
git status
git log -1
- name: List contents of images dir
continue-on-error: true
run: ls -al ${{ env.hugo_image_cache_path }}
- name: Cache images dir
uses: actions/cache@v2
with:
path: ${{ env.hugo_image_cache_path }}
key: ${{ env.hugo_image_cache_name }}-${{ github.run_id }}
restore-keys: |
${{ env.hugo_image_cache_name }}
- name: List contents of images dir
continue-on-error: true
run: ls -al ${{ env.hugo_image_cache_path }}
- name: Install dependencies (Node)
working-directory: ./docs-repo
run: npm ci
- name: Set up Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.116.1'
- name: Build Hugo
working-directory: ./docs-repo
run: hugo --gc
- name: List existing Hugo image caches
run: |
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ env.repo_owner }}/${{ env.repo_name }}/actions/caches?key=${{ env.hugo_image_cache_name }} \
-o cache-list.json
echo "The following caches will be deleted:"
cat cache-list.json
- name: Delete existing Hugo image caches
run: |
for id in $(jq '.actions_caches[].id' cache-list.json); do
echo "Deleting cache with id $id"
curl \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ env.repo_owner }}/${{ env.repo_name }}/actions/caches/$id
done