|
| 1 | +# Sample workflow for building and deploying a Jekyll site to GitHub Pages |
| 2 | +name: Deploy implementation-guide to GitHub pages |
| 3 | + |
| 4 | +on: |
| 5 | + # Runs on pushes targeting the default branch |
| 6 | + push: |
| 7 | + branches: ["main", "deploy_ig_pages"] |
| 8 | + |
| 9 | + # Allows you to run this workflow manually from the Actions tab |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + pages: write |
| 16 | + id-token: write |
| 17 | + |
| 18 | +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 19 | +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 20 | +concurrency: |
| 21 | + group: "pages" |
| 22 | + cancel-in-progress: false |
| 23 | + |
| 24 | +jobs: |
| 25 | + # Build job |
| 26 | + build: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + steps: |
| 29 | + - name: Checkout |
| 30 | + uses: actions/checkout@v3 |
| 31 | + |
| 32 | + # Set up languages framework and libraries |
| 33 | + - uses: actions/setup-java@v3 |
| 34 | + with: |
| 35 | + distribution: 'temurin' |
| 36 | + java-version: '17' |
| 37 | + |
| 38 | + - name: Setup Gradle |
| 39 | + uses: gradle/gradle-build-action@v2 |
| 40 | + |
| 41 | + - name: Setup Ruby |
| 42 | + uses: ruby/setup-ruby@v1 |
| 43 | + with: |
| 44 | + ruby-version: 3.2 |
| 45 | + |
| 46 | + - name: Install Jekyll |
| 47 | + run: | |
| 48 | + gem install jekyll bundler |
| 49 | +
|
| 50 | + # Build IG |
| 51 | + - run: gradle buildIG |
| 52 | + continue-on-error: true |
| 53 | + |
| 54 | + # Upload IG artifact |
| 55 | + - name: Setup Pages |
| 56 | + uses: actions/configure-pages@v3 |
| 57 | + |
| 58 | + - name: Fix permissions |
| 59 | + run: cp -r ./output _site |
| 60 | + |
| 61 | + - name: Fix permissions |
| 62 | + run: | |
| 63 | + chmod -c -R +rX "_site/" | while read line; do |
| 64 | + echo "::warning title=Invalid file permissions automatically fixed::$line" |
| 65 | + done |
| 66 | +
|
| 67 | + - name: Upload artifact |
| 68 | + uses: actions/upload-pages-artifact@v2 |
| 69 | + |
| 70 | + # Deployment job |
| 71 | + deploy: |
| 72 | + environment: |
| 73 | + name: github-pages |
| 74 | + url: ${{ steps.deployment.outputs.page_url }} |
| 75 | + runs-on: ubuntu-latest |
| 76 | + needs: build |
| 77 | + steps: |
| 78 | + - name: Deploy to GitHub Pages |
| 79 | + id: deployment |
| 80 | + uses: actions/deploy-pages@v2 |
0 commit comments