Skip to content

⏫ Promoting release 2409271652000 to Beta/Experimental traffic channe… #730

⏫ Promoting release 2409271652000 to Beta/Experimental traffic channe…

⏫ Promoting release 2409271652000 to Beta/Experimental traffic channe… #730

name: Sync versions.json to CDN
on:
push:
branches:
- main
paths:
- configs/versions.json
workflow_dispatch:
# TODO(danielrozenberg): temporary, remove after testing is done
jobs:
sync:
if: github.repository == 'ampproject/cdn-configuration'
name: versions.json
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 1
- name: Install Dependencies
run: npm i -g @cloudflare/wrangler
- name: ⭐ Sync versions.json to the CDN ⭐
run: |
for CHANNEL in $(jq 'keys[]' configs/versions.json --raw-output)
do
RTV=$(jq ".[\"${CHANNEL}\"]" configs/versions.json --raw-output)
if [[ "${RTV}" != "null" ]]
then
echo "Setting ${CHANNEL} to ${RTV}"
wrangler kv:key put "${CHANNEL}" "${RTV}" --config .github/workflows/wrangler.toml --binding RTV
else
echo "Unsetting ${CHANNEL}"
wrangler kv:key delete "${CHANNEL}" --config .github/workflows/wrangler.toml --binding RTV --force
fi
done
env:
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
create-issue-on-error:
if: failure()
needs: sync
permissions:
contents: read
issues: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Create issue on error
uses: JasonEtco/create-an-issue@v2
with:
filename: .github/create_issue_on_error.md
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
WORKFLOW_NAME: ${{ github.workflow }}
MENTION: '@ampproject/release-on-duty'
REPO_SLUG: ${{ github.repository }}
RUN_ID: ${{ github.run_id }}