|
1 | | -contents: write |
| 1 | +name: Deploy Combined Docs |
2 | 2 |
|
| 3 | +# Define the events that trigger this workflow |
| 4 | +on: |
| 5 | + # Run on push to the main branch |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + # Allow manual triggering from the GitHub UI |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +# Set permissions needed for deployment |
| 13 | +permissions: |
| 14 | + contents: write |
| 15 | + |
| 16 | +# Define the jobs to run |
3 | 17 | jobs: |
4 | 18 | deploy: |
5 | 19 | runs-on: ubuntu-latest |
6 | 20 | steps: |
7 | | - - uses: actions/checkout@v3 |
| 21 | + # Check out the repository code |
| 22 | + - name: Checkout code |
| 23 | + uses: actions/checkout@v3 |
8 | 24 | with: |
9 | 25 | fetch-depth: 0 |
10 | 26 |
|
11 | | - - name: Create site directory and clear cache |
| 27 | + # Create the site directory |
| 28 | + - name: Create site directory |
12 | 29 | run: | |
13 | 30 | mkdir -p build/site |
14 | 31 | rm -rf aas-specifications idta-submodel-templates |
15 | 32 |
|
16 | | - - name: Copy existing index.html |
| 33 | + # Copy and modify the index.html file |
| 34 | + - name: Copy and update index.html |
17 | 35 | run: | |
18 | 36 | cp index.html build/site/index.html |
19 | 37 | sed -i 's|<h1>IDTA AAS Specification Documentation</h1>|<h1>Industrial Digital Twin Documentation</h1>|g' build/site/index.html |
20 | 38 | sed -i 's|<h2 style="color:red;">THIS IS A TEST - SHOULD BE VISIBLE</h2>|<h2 style="color:red;">THIS IS A TEST - UPDATED VERSION - DEPLOYED AT '"$(date)"'</h2>|g' build/site/index.html |
21 | 39 | sed -i 's|href="/aas-specifications/|href="./aas-specifications/|g' build/site/index.html |
22 | 40 | sed -i 's|href="/idta-submodel-templates/|href="./idta-submodel-templates/|g' build/site/index.html |
| 41 | + echo "Updated index.html content:" |
23 | 42 | cat build/site/index.html |
24 | 43 |
|
25 | | - - name: Copy other required files |
| 44 | + # Create necessary files for GitHub Pages |
| 45 | + - name: Create GitHub Pages files |
26 | 46 | run: | |
27 | 47 | touch build/site/.nojekyll |
28 | 48 | echo "industrialdigitaltwin.io" > build/site/CNAME |
29 | 49 | ls -la build/site/ |
30 | 50 |
|
| 51 | + # Download AAS Specifications |
31 | 52 | - name: Download AAS Specifications site |
32 | 53 | run: | |
33 | 54 | mkdir -p build/site/aas-specifications |
|
36 | 57 | echo "Contents of aas-specifications directory:" |
37 | 58 | ls -la aas-specifications/ || echo "No files found" |
38 | 59 |
|
| 60 | + # Download Submodel Templates |
39 | 61 | - name: Download Submodel Templates site |
40 | 62 | run: | |
41 | 63 | mkdir -p build/site/idta-submodel-templates |
|
44 | 66 | echo "Contents of idta-submodel-templates directory:" |
45 | 67 | ls -la idta-submodel-templates/ || echo "No files found" |
46 | 68 |
|
| 69 | + # List all deployed files for debugging |
47 | 70 | - name: List deployed files |
48 | 71 | run: | |
49 | 72 | echo "Contents of build/site root:" |
|
53 | 76 | echo "Contents of idta-submodel-templates directory:" |
54 | 77 | ls -la build/site/idta-submodel-templates/ || echo "Directory empty or not found" |
55 | 78 |
|
| 79 | + # Deploy to GitHub Pages |
56 | 80 | - name: Deploy to GitHub Pages |
57 | 81 | uses: JamesIves/github-pages-deploy-action@v4 |
58 | 82 | with: |
|
0 commit comments