cc-mek-scada/.github/workflows/manifest.yml

100 lines
3.5 KiB
YAML
Raw Normal View History

2023-05-28 03:36:32 +00:00
# Simple workflow for deploying static content to GitHub Pages
2023-05-31 15:19:32 +00:00
name: Deploy Installation Manifests and Versions
2023-05-28 03:36:32 +00:00
on:
workflow_dispatch:
push:
branches:
- main
- latest
- devel
# 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: Setup Pages
uses: actions/configure-pages@v3
- name: Setup Python
uses: actions/setup-python@v3.1.3
- name: Create outputs folders
2023-05-28 03:36:32 +00:00
shell: bash
run: mkdir deploy; mkdir deploy/manifests; mkdir deploy/manifests/main deploy/manifests/latest deploy/manifests/devel
# Generate manifest + shields files for main branch
- name: Checkout main
2023-06-07 19:28:49 +00:00
id: checkout-main
uses: actions/checkout@v3
with:
ref: 'main'
clean: false
2023-05-31 15:19:32 +00:00
- name: Generate manifest and shields for main branch
2023-06-07 19:28:49 +00:00
id: manifest-main
2023-06-07 19:35:25 +00:00
if: ${{ steps.checkout-main.outcome }} == 'success'
run: python imgen.py shields
- name: Save main's manifest
2023-06-07 19:35:25 +00:00
if: ${{ steps.manifest-main.outcome }} == 'success'
run: mv install_manifest.json deploy/manifests/main
# Generate manifest for latest branch
- name: Checkout latest
2023-06-07 19:28:49 +00:00
id: checkout-latest
if: success() || failure()
uses: actions/checkout@v3
with:
ref: 'latest'
clean: false
- name: Generate manifest for latest
2023-06-07 19:28:49 +00:00
id: manifest-latest
2023-06-07 19:35:25 +00:00
if: ${{ steps.checkout-latest.outcome }} == 'success'
run: python imgen.py
- name: Save latest's manifest
2023-06-07 19:35:25 +00:00
if: ${{ steps.manifest-latest.outcome }} == 'success'
run: mv install_manifest.json deploy/manifests/latest
# Generate manifest for devel branch
- name: Checkout devel
2023-06-07 19:28:49 +00:00
id: checkout-devel
if: success() || failure()
uses: actions/checkout@v3
with:
ref: 'devel'
clean: false
2023-06-07 19:43:03 +00:00
- name: test
2023-06-07 19:44:07 +00:00
if: always()
2023-06-07 19:45:37 +00:00
run: echo ${{ steps.checkout-devel.outcome }} == 'success'
2023-06-07 19:43:03 +00:00
- name: test2
2023-06-07 19:44:07 +00:00
if: always()
2023-06-07 19:55:46 +00:00
run: echo ${{ steps.checkout-devel.outcome }}
- name: Generate manifest for devel
2023-06-07 19:28:49 +00:00
id: manifest-devel
2023-06-07 19:55:46 +00:00
if: ${{ always() && steps.checkout-devel.outcome == 'success' }}
2023-05-31 15:17:44 +00:00
run: python imgen.py
- name: Save devel's manifest
2023-06-07 19:43:03 +00:00
if: ${{ steps.checkout-devel.success }}
run: mv install_manifest.json deploy/manifests/devel
# All artifacts ready now, upload deploy directory
2023-05-31 15:15:55 +00:00
- name: Upload artifacts
2023-06-07 19:28:49 +00:00
if: steps.manifest-main.outcome == 'success' || steps.manifest-latest.outcome == 'success' || steps.manifest-devel.outcome == 'success'
2023-05-28 03:36:32 +00:00
uses: actions/upload-pages-artifact@v1
with:
# Upload manifest JSON
2023-05-31 15:15:55 +00:00
path: 'deploy/'
2023-05-28 03:36:32 +00:00
- name: Deploy to GitHub Pages
2023-06-07 19:28:49 +00:00
if: steps.manifest-main.outcome == 'success' || steps.manifest-latest.outcome == 'success' || steps.manifest-devel.outcome == 'success'
2023-05-28 03:36:32 +00:00
id: deployment
uses: actions/deploy-pages@v2