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

80 lines
2.8 KiB
YAML
Raw Normal View History

# Deploy installation manifests and shields versions
name: Deploy Installation Data
2023-05-28 03:36:32 +00:00
on:
workflow_dispatch:
push:
branches:
- main
- 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
# 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'
2023-06-07 20:04:39 +00:00
clean: false
- name: Create outputs folders
2023-06-07 20:07:12 +00:00
if: success() || failure()
2023-06-07 20:04:39 +00:00
shell: bash
2024-02-20 01:40:05 +00:00
run: mkdir deploy; mkdir deploy/manifests; mkdir deploy/manifests/main deploy/manifests/devel
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 20:07:12 +00:00
if: ${{ (success() || failure()) && steps.checkout-main.outcome == 'success' }}
2024-07-06 04:55:03 +00:00
run: python build/imgen.py shields
- name: Save main's manifest
2023-06-07 20:07:12 +00:00
if: ${{ (success() || failure()) && steps.manifest-main.outcome == 'success' }}
run: mv install_manifest.json deploy/manifests/main
# 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'
2023-06-07 20:04:39 +00:00
clean: false
- name: Generate manifest for devel
2023-06-07 19:28:49 +00:00
id: manifest-devel
2023-06-07 19:57:07 +00:00
if: ${{ (success() || failure()) && steps.checkout-devel.outcome == 'success' }}
2024-06-30 16:36:22 +00:00
run: python build/imgen.py
- name: Save devel's manifest
2023-06-07 19:57:07 +00:00
if: ${{ (success() || failure()) && steps.manifest-devel.outcome == '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 20:07:12 +00:00
id: upload-artifacts
if: ${{ (success() || failure()) && (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 20:07:12 +00:00
if: ${{ (success() || failure()) && steps.upload-artifacts.outcome == 'success' }}
2023-05-28 03:36:32 +00:00
id: deployment
uses: actions/deploy-pages@v2