Skip to content

Commit

Permalink
Fix workflow permissions (#39)
Browse files Browse the repository at this point in the history
- Add write permissions to github workflow release.yml
- Integrated build-gh-pages.yml into build-doc.yml (similar to
build-doc.yml for cimpy)
  • Loading branch information
m-mirz authored Jan 5, 2025
2 parents 10d6cac + 94ac78c commit 498ca3f
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 43 deletions.
59 changes: 53 additions & 6 deletions .github/workflows/build-doc.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: build-doc

name: Documentation
on:
pull_request:
push:
workflow_call:
branches: [master]

jobs:
build-doc:
build-doc-artifacts:
name: Build and Upload doc Artifacts
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -18,12 +19,13 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Doxygen
run: sudo apt-get install doxygen
shell: bash
run: sudo apt-get install doxygen
- name: Install Graphviz
run: sudo apt-get install graphviz
shell: bash
run: sudo apt-get install graphviz
- name: Create Build Environment
shell: bash
run: cmake -E make_directory ${{runner.workspace}}/libcimpp/build/${{matrix.schema}}
- name: Configure CMake and compile
shell: bash
Expand All @@ -36,3 +38,48 @@ jobs:
with:
name: doc_${{matrix.schema}}
path: ${{runner.workspace}}/libcimpp/build/${{matrix.schema}}/doc/html

build-gh-pages-artifact:
name: Build and Upload Artifact github-pages
needs: build-doc-artifacts
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
env:
CIM_1: CGMES_2.4.13_18DEC2013
CIM_2: CGMES_2.4.15_16FEB2016
CIM_3: CGMES_2.4.15_27JAN2020
CIM_4: CGMES_3.0.0
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Download
uses: actions/download-artifact@v4
- name: Copy
shell: bash
run: |
mkdir -p ./copy_files/docs
cp -r ./doc_${{env.CIM_1}} ./copy_files/docs/${{env.CIM_1}}
cp -r ./doc_${{env.CIM_2}} ./copy_files/docs/${{env.CIM_2}}
cp -r ./doc_${{env.CIM_3}} ./copy_files/docs/${{env.CIM_3}}
cp -r ./doc_${{env.CIM_4}} ./copy_files/docs/${{env.CIM_4}}
cp ./README.md ./copy_files/docs/README.md
- name: Upload Artifact github-pages
uses: actions/upload-pages-artifact@v3
with:
path: ./copy_files/docs

deploy-gh-pages:
name: Deploy github-pages
needs: build-gh-pages-artifact
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
33 changes: 0 additions & 33 deletions .github/workflows/build-gh-pages.yml

This file was deleted.

7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Release packages

on:
push:
tags:
- 'release/v*'

tags: ['release/v*']
jobs:
package:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -36,6 +33,8 @@ jobs:
release:
needs: package
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: GetArtifact
uses: actions/download-artifact@v4
Expand Down

0 comments on commit 498ca3f

Please sign in to comment.