fix shields deploy

This commit is contained in:
Mikayla Fischler 2023-05-31 11:15:55 -04:00
parent dbd74afbe6
commit deec1ff1df
3 changed files with 12 additions and 60 deletions

View File

@ -1,5 +1,5 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy Installation Manifests
name: Deploy Installation Manifests and Component Versions
on:
workflow_dispatch:
@ -8,11 +8,6 @@ on:
- main
- latest
- devel
pull_request:
branches:
- main
- latest
- devel
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
@ -46,16 +41,20 @@ jobs:
id: extract_branch
- name: Create outputs folder
shell: bash
run: mkdir temp; mkdir temp/manifests; mkdir temp/manifests/${{ steps.extract_branch.outputs.branch }}
run: mkdir deploy; mkdir deploy/manifests; mkdir temp/manifests/${{ steps.extract_branch.outputs.branch }}
- name: Generate manifest and shields for master
if: github.event.pull_request.base.ref == 'master'
run: python imgen.py gh_actions
- name: Generate manifest
run: python imgen.py
if: github.event.pull_request.base.ref != 'master'
run: python imgen.p
- name: Move manifest
run: mv install_manifest.json temp/manifests/${{ steps.extract_branch.outputs.branch }}
- name: Upload artifact
run: mv install_manifest.json deploy/manifests/${{ steps.extract_branch.outputs.branch }}
- name: Upload artifacts
uses: actions/upload-pages-artifact@v1
with:
# Upload manifest JSON
path: 'temp/'
path: 'deploy/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

View File

@ -1,47 +0,0 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy Component Versions
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Setup Python
uses: actions/setup-python@v3.1.3
- run: mkdir shields
- run: python imgen.py shields
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload shields JSON
path: 'shields/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

View File

@ -108,10 +108,10 @@ f = open("install_manifest.json", "w")
json.dump(final_manifest, f)
f.close()
if len(sys.argv) > 1 and sys.argv[1] == "shields":
if len(sys.argv) > 1 and sys.argv[1] == "gh_actions":
# write all the JSON files for shields.io
for key, version in final_manifest["versions"].items():
f = open("./shields/" + key + ".json", "w")
f = open("./deploy/" + key + ".json", "w")
if version.find("alpha") >= 0:
color = "yellow"