Skip to content

Main cacheKeys workflow #8

Main cacheKeys workflow

Main cacheKeys workflow #8

Workflow file for this run

name: Main cacheKeys workflow
on:
workflow_dispatch:
jobs:
getRepoCacheVars:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Print all var names before change
run: |
echo "ALTERNATE_BIOMES_CACHEKEY is ${{ vars.ALTERNATE_BIOMES_CACHEKEY }}"
echo "APOTHEOSIS_CACHEKEY is ${{ vars.APOTHEOSIS_CACHEKEY }}"
echo "APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY is ${{ vars.APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY }}"
echo "APOTHEOSIS_TUONELA_CACHEKEY is ${{ vars.APOTHEOSIS_TUONELA_CACHEKEY }}"
echo "NEW_GAME_PLUS_HD_CACHEKEY is ${{ vars.NEW_GAME_PLUS_HD_CACHEKEY }}"
echo "NIGHTMARE_HD_CACHEKEY is ${{ vars.NIGHTMARE_HD_CACHEKEY }}"
echo "NOITAVANIA_CACHEKEY is ${{ vars.NOITAVANIA_CACHEKEY }}"
echo "NOITAVANIA_NEW_GAME_PLUS_CACHEKEY is ${{ vars.NOITAVANIA_NEW_GAME_PLUS_CACHEKEY }}"
echo "PURGATORY_CACHEKEY is ${{ vars.PURGATORY_CACHEKEY }}"
echo "REGULAR_LEFT_PW_CACHEKEY is ${{ vars.REGULAR_LEFT_PW_CACHEKEY }}"
echo "REGULAR_MAIN_BRANCH_CACHEKEY is ${{ vars.REGULAR_MAIN_BRANCH_CACHEKEY }}"
echo "REGULAR_MIDDLE_CACHEKEY is ${{ vars.REGULAR_MIDDLE_CACHEKEY }}"
echo "REGULAR_RIGHT_PW_CACHEKEY is ${{ vars.REGULAR_RIGHT_PW_CACHEKEY }}"
- name: ALTERNATE_BIOMES_CACHEKEY
run: echo "current ALTERNATE_BIOMES_CACHEKEY = ${{ env.ALTERNATE_BIOMES_CACHEKEY }}"
- name: Get CF deployment for ALTERNATE_BIOMES_CACHEKEY
id: get_cf_deployments_ALTERNATE_BIOMES
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.ALTERNATE_BIOMES_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for ALTERNATE_BIOMES_CACHEKEY
id: get_modified_on_ALTERNATE_BIOMES
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_ALTERNATE_BIOMES.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for ALTERNATE_BIOMES_CACHEKEY
id: gh_cachekey_update_ALTERNATE_BIOMES
run: |
PROJECT_CACHEKEY_VAR="ALTERNATE_BIOMES_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_ALTERNATE_BIOMES.outputs.modified_on }}\"}"
- name: APOTHEOSIS_CACHEKEY
run: echo "current APOTHEOSIS_CACHEKEY = ${{ env.APOTHEOSIS_CACHEKEY }}"
- name: Get CF deployment for APOTHEOSIS_CACHEKEY
id: get_cf_deployments_APOTHEOSIS
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.APOTHEOSIS_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for APOTHEOSIS_CACHEKEY
id: get_modified_on_APOTHEOSIS
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_APOTHEOSIS.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for APOTHEOSIS_CACHEKEY
id: gh_cachekey_update_APOTHEOSIS
run: |
PROJECT_CACHEKEY_VAR="APOTHEOSIS_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_APOTHEOSIS.outputs.modified_on }}\"}"
- name: APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY
run: echo "current APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY = ${{ env.APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY }}"
- name: Get CF deployment for APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY
id: get_cf_deployments_APOTHEOSIS_NEW_GAME_PLUS
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.APOTHEOSIS_NEW_GAME_PLUS_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY
id: get_modified_on_APOTHEOSIS_NEW_GAME_PLUS
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_APOTHEOSIS_NEW_GAME_PLUS.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY
id: gh_cachekey_update_APOTHEOSIS_NEW_GAME_PLUS
run: |
PROJECT_CACHEKEY_VAR="APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_APOTHEOSIS_NEW_GAME_PLUS.outputs.modified_on }}\"}"
- name: APOTHEOSIS_TUONELA_CACHEKEY
run: echo "current APOTHEOSIS_TUONELA_CACHEKEY = ${{ env.APOTHEOSIS_TUONELA_CACHEKEY }}"
- name: Get CF deployment for APOTHEOSIS_TUONELA_CACHEKEY
id: get_cf_deployments_APOTHEOSIS_TUONELA
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.APOTHEOSIS_TUONELA_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for APOTHEOSIS_TUONELA_CACHEKEY
id: get_modified_on_APOTHEOSIS_TUONELA
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_APOTHEOSIS_TUONELA.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for APOTHEOSIS_TUONELA_CACHEKEY
id: gh_cachekey_update_APOTHEOSIS_TUONELA
run: |
PROJECT_CACHEKEY_VAR="APOTHEOSIS_TUONELA_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_APOTHEOSIS_TUONELA.outputs.modified_on }}\"}"
- name: NEW_GAME_PLUS_HD_CACHEKEY
run: echo "current NEW_GAME_PLUS_HD_CACHEKEY = ${{ env.NEW_GAME_PLUS_HD_CACHEKEY }}"
- name: Get CF deployment for NEW_GAME_PLUS_HD_CACHEKEY
id: get_cf_deployments_NEW_GAME_PLUS_HD
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.NEW_GAME_PLUS_HD_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for NEW_GAME_PLUS_HD_CACHEKEY
id: get_modified_on_NEW_GAME_PLUS_HD
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_NEW_GAME_PLUS_HD.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for NEW_GAME_PLUS_HD_CACHEKEY
id: gh_cachekey_update_NEW_GAME_PLUS_HD
run: |
PROJECT_CACHEKEY_VAR="NEW_GAME_PLUS_HD_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_NEW_GAME_PLUS_HD.outputs.modified_on }}\"}"
- name: NIGHTMARE_HD_CACHEKEY
run: echo "current NIGHTMARE_HD_CACHEKEY = ${{ env.NIGHTMARE_HD_CACHEKEY }}"
- name: Get CF deployment for NIGHTMARE_HD_CACHEKEY
id: get_cf_deployments_NIGHTMARE_HD
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.NIGHTMARE_HD_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for NIGHTMARE_HD_CACHEKEY
id: get_modified_on_NIGHTMARE_HD
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_NIGHTMARE_HD.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for NIGHTMARE_HD_CACHEKEY
id: gh_cachekey_update_NIGHTMARE_HD
run: |
PROJECT_CACHEKEY_VAR="NIGHTMARE_HD_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_NIGHTMARE_HD.outputs.modified_on }}\"}"
- name: NOITAVANIA_CACHEKEY
run: echo "current NOITAVANIA_CACHEKEY = ${{ env.NOITAVANIA_CACHEKEY }}"
- name: Get CF deployment for NOITAVANIA_CACHEKEY
id: get_cf_deployments_NOITAVANIA
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.NOITAVANIA_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for NOITAVANIA_CACHEKEY
id: get_modified_on_NOITAVANIA
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_NOITAVANIA.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for NOITAVANIA_CACHEKEY
id: gh_cachekey_update_NOITAVANIA
run: |
PROJECT_CACHEKEY_VAR="NOITAVANIA_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_NOITAVANIA.outputs.modified_on }}\"}"
- name: NOITAVANIA_NEW_GAME_PLUS_CACHEKEY
run: echo "current NOITAVANIA_NEW_GAME_PLUS_CACHEKEY = ${{ env.NOITAVANIA_NEW_GAME_PLUS_CACHEKEY }}"
- name: Get CF deployment for NOITAVANIA_NEW_GAME_PLUS_CACHEKEY
id: get_cf_deployments_NOITAVANIA_NEW_GAME_PLUS
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.NOITAVANIA_NEW_GAME_PLUS_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for NOITAVANIA_NEW_GAME_PLUS_CACHEKEY
id: get_modified_on_NOITAVANIA_NEW_GAME_PLUS
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_NOITAVANIA_NEW_GAME_PLUS.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for NOITAVANIA_NEW_GAME_PLUS_CACHEKEY
id: gh_cachekey_update_NOITAVANIA_NEW_GAME_PLUS
run: |
PROJECT_CACHEKEY_VAR="NOITAVANIA_NEW_GAME_PLUS_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_NOITAVANIA_NEW_GAME_PLUS.outputs.modified_on }}\"}"
- name: PURGATORY_CACHEKEY
run: echo "current PURGATORY_CACHEKEY = ${{ env.PURGATORY_CACHEKEY }}"
- name: Get CF deployment for PURGATORY_CACHEKEY
id: get_cf_deployments_PURGATORY
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.PURGATORY_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for PURGATORY_CACHEKEY
id: get_modified_on_PURGATORY
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_PURGATORY.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for PURGATORY_CACHEKEY
id: gh_cachekey_update_PURGATORY
run: |
PROJECT_CACHEKEY_VAR="PURGATORY_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_PURGATORY.outputs.modified_on }}\"}"
- name: REGULAR_LEFT_PW_CACHEKEY
run: echo "current REGULAR_LEFT_PW_CACHEKEY = ${{ env.REGULAR_LEFT_PW_CACHEKEY }}"
- name: Get CF deployment for REGULAR_LEFT_PW_CACHEKEY
id: get_cf_deployments_REGULAR_LEFT_PW
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.REGULAR_LEFT_PW_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for REGULAR_LEFT_PW_CACHEKEY
id: get_modified_on_REGULAR_LEFT_PW
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_REGULAR_LEFT_PW.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for REGULAR_LEFT_PW_CACHEKEY
id: gh_cachekey_update_REGULAR_LEFT_PW
run: |
PROJECT_CACHEKEY_VAR="REGULAR_LEFT_PW_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_REGULAR_LEFT_PW.outputs.modified_on }}\"}"
- name: REGULAR_MAIN_BRANCH_CACHEKEY
run: echo "current REGULAR_MAIN_BRANCH_CACHEKEY = ${{ env.REGULAR_MAIN_BRANCH_CACHEKEY }}"
- name: Get CF deployment for REGULAR_MAIN_BRANCH_CACHEKEY
id: get_cf_deployments_REGULAR_MAIN_BRANCH
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.REGULAR_MAIN_BRANCH_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for REGULAR_MAIN_BRANCH_CACHEKEY
id: get_modified_on_REGULAR_MAIN_BRANCH
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_REGULAR_MAIN_BRANCH.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for REGULAR_MAIN_BRANCH_CACHEKEY
id: gh_cachekey_update_REGULAR_MAIN_BRANCH
run: |
PROJECT_CACHEKEY_VAR="REGULAR_MAIN_BRANCH_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_REGULAR_MAIN_BRANCH.outputs.modified_on }}\"}"
- name: REGULAR_MIDDLE_CACHEKEY
run: echo "current REGULAR_MIDDLE_CACHEKEY = ${{ env.REGULAR_MIDDLE_CACHEKEY }}"
- name: Get CF deployment for REGULAR_MIDDLE_CACHEKEY
id: get_cf_deployments_REGULAR_MIDDLE
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.REGULAR_MIDDLE_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for REGULAR_MIDDLE_CACHEKEY
id: get_modified_on_REGULAR_MIDDLE
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_REGULAR_MIDDLE.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for REGULAR_MIDDLE_CACHEKEY
id: gh_cachekey_update_REGULAR_MIDDLE
run: |
PROJECT_CACHEKEY_VAR="REGULAR_MIDDLE_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_REGULAR_MIDDLE.outputs.modified_on }}\"}"
- name: REGULAR_RIGHT_PW_CACHEKEY
run: echo "current REGULAR_RIGHT_PW_CACHEKEY = ${{ env.REGULAR_RIGHT_PW_CACHEKEY }}"
- name: Get CF deployment for REGULAR_RIGHT_PW_CACHEKEY
id: get_cf_deployments_REGULAR_RIGHT_PW
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.REGULAR_RIGHT_PW_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for REGULAR_RIGHT_PW_CACHEKEY
id: get_modified_on_REGULAR_RIGHT_PW
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_REGULAR_RIGHT_PW.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for REGULAR_RIGHT_PW_CACHEKEY
id: gh_cachekey_update_REGULAR_RIGHT_PW
run: |
PROJECT_CACHEKEY_VAR="REGULAR_RIGHT_PW_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_REGULAR_RIGHT_PW.outputs.modified_on }}\"}"
- name: Print all var names after change
run: |
echo "ALTERNATE_BIOMES_CACHEKEY is ${{ vars.ALTERNATE_BIOMES_CACHEKEY }}"
echo "APOTHEOSIS_CACHEKEY is ${{ vars.APOTHEOSIS_CACHEKEY }}"
echo "APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY is ${{ vars.APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY }}"
echo "APOTHEOSIS_TUONELA_CACHEKEY is ${{ vars.APOTHEOSIS_TUONELA_CACHEKEY }}"
echo "NEW_GAME_PLUS_HD_CACHEKEY is ${{ vars.NEW_GAME_PLUS_HD_CACHEKEY }}"
echo "NIGHTMARE_HD_CACHEKEY is ${{ vars.NIGHTMARE_HD_CACHEKEY }}"
echo "NOITAVANIA_CACHEKEY is ${{ vars.NOITAVANIA_CACHEKEY }}"
echo "NOITAVANIA_NEW_GAME_PLUS_CACHEKEY is ${{ vars.NOITAVANIA_NEW_GAME_PLUS_CACHEKEY }}"
echo "PURGATORY_CACHEKEY is ${{ vars.PURGATORY_CACHEKEY }}"
echo "REGULAR_LEFT_PW_CACHEKEY is ${{ vars.REGULAR_LEFT_PW_CACHEKEY }}"
echo "REGULAR_MAIN_BRANCH_CACHEKEY is ${{ vars.REGULAR_MAIN_BRANCH_CACHEKEY }}"
echo "REGULAR_MIDDLE_CACHEKEY is ${{ vars.REGULAR_MIDDLE_CACHEKEY }}"
echo "REGULAR_RIGHT_PW_CACHEKEY is ${{ vars.REGULAR_RIGHT_PW_CACHEKEY }}"
- name: Print current directory
run: pwd
- name: List directory contents
run: ls -la
- name: Update index.html
run: |
perl -0777 -pi -e 's#<script id="cachekeys">.*</script>#<script id="cachekeys">const tilemodified_ons = {\n"regular-middle.acidflow.stream": "${{ steps.get_modified_on_REGULAR_MIDDLE.modified_on }}",\n"regular-left-pw.acidflow.stream": "${{ steps.get_modified_on_REGULAR_LEFT_PW.modified_on }}",\n"regular-right-pw.acidflow.stream": "${{ steps.get_modified_on_REGULAR_RIGHT_PW.modified_on }}",\n"nightmare-hd.acidflow.stream": "${{ steps.get_modified_on_NIGHTMARE_HD.modified_on }}",\n"new-game-plus-hd.acidflow.stream": "${{ steps.get_modified_on_NEW_GAME_PLUS_HD.modified_on }}",\n"regular-main-branch.acidflow.stream": "${{ steps.get_modified_on_REGULAR_MAIN_BRANCH.modified_on }}",\n"purgatory.acidflow.stream": "${{ steps.get_modified_on_PURGATORY.modified_on }}",\n"apotheosis.acidflow.stream": "${{ steps.get_modified_on_APOTHEOSIS.modified_on }}",\n"apotheosis-new-game-plus.acidflow.stream": "${{ steps.get_modified_on_APOTHEOSIS_NEW_GAME_PLUS.modified_on }}",\n"noitavania.acidflow.stream": "${{ steps.get_modified_on_NOITAVANIA.modified_on }}",\n"noitavania-new-game-plus.acidflow.stream": "${{ steps.get_modified_on_NOITAVANIA_NEW_GAME_PLUS.modified_on }}",\n"alternate-biomes.acidflow.stream": "${{ steps.get_modified_on_ALTERNATE_BIOMES.modified_on }}",\n"apotheosis-tuonela.acidflow.stream": "${{ steps.get_modified_on_APOTHEOSIS_TUONELA.modified_on }}"\n};</script>#s' public/index.html
- name: Commit index.html changes
id: commit
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Actions"
git add public/index.html
if [ -z "$(git status --porcelain)" ]; then
echo "push=false" >> $GITHUB_OUTPUT
else
git commit -m "Update index.html"
echo "push=true" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Push changes
if: steps.commit.outputs.push == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_ACIDFRLOW_COMMIT_TO_REPO }}