Skip to content

wip

wip #8

name: Push Opflex Base Tags
on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
workflow_dispatch:
push: #for testing only, remove before merge
branches:
- 'add-opflex-info'
jobs:
update-releases:
runs-on: ubuntu-latest
env:
CICD_REPO: "noironetworks/test-cicd-status"
OPFLEX_REPO: "noironetworks/opflex"
CICD_DIR: ${{ github.workspace }}/test-cicd-status
OPFLEX_DIR: ${{ github.workspace }}/opflex
WORKSPACE_DIR: ${{ github.workspace }}/workspace
steps:

Check failure on line 19 in .github/workflows/push-opflex-base-tag.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/push-opflex-base-tag.yml

Invalid workflow file

You have an error in your yaml syntax on line 19
- name: Checkout Main Repository
uses: actions/checkout@v4
- name: Checkout test-cicd-status Repository
uses: actions/checkout@v4
with:
repository: ${{ env.CICD_REPO }}
path: ${{ env.CICD_DIR }}
fetch-depth: 1
- name: Checkout OpFlex Repository
uses: actions/checkout@v4
with:
repository: ${{ env.OPFLEX_REPO }}
path: ${{ env.OPFLEX_DIR }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: pip install pyyaml jq
- name: Create workspace directory
run: mkdir -p ${{ env.WORKSPACE_DIR }}
- name: Extract current tags opflex metadata
run: python .github/scripts/extract_opflex_metadata.py ${{ env.CICD_DIR }} ${{ env.WORKSPACE_DIR }}/opflex_metadata.json
- name: Print Metadata File
if: success()
run: |
echo "Printing opflex_metadata.json:"
cat "${{ env.WORKSPACE_DIR }}/opflex_metadata.json" || echo "ERR: Unable to read $METADATA_FILE"
- name: Push subsequent tags (only if digest changed)
run: bash .github/scripts/push_opflex_tags.sh ${{ env.WORKSPACE_DIR }}/opflex_metadata.json ${{ env.WORKSPACE_DIR }}/updated_metadata.json
- name: Print Updated Metadata File
if: success()
run: |
echo "Printing opflex_metadata.json:"
cat "${{ env.WORKSPACE_DIR }}/updated_metadata.json" || echo "ERR: Unable to read $METADATA_FILE"
- name: Update releases.yaml with new OpFlex metadata
run: python .github/scripts/update_releases.py ${{ env.WORKSPACE_DIR }}/updated_metadata.json ${{ env.CICD_DIR }}/docs/release_artifacts/releases.yaml
- name: Commit and Push Updated releases.yaml
run: |
cd ${{ env.CICD_DIR }}
if git diff --quiet docs/release_artifacts/releases.yaml; then
echo "No changes in releases.yaml. Skipping commit."
else
git add docs/release_artifacts/releases.yaml
git commit -m "Update stored digests in releases.yaml"
git push origin main
fi