⏫ Promoting release 2410250306000 to Beta/Experimental traffic channe… #750
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: 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@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # 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@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # 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 }} |