|
| 1 | +# |
| 2 | +# Copyright 2022 Winford (Uncle Grumpy) <[email protected]> |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later |
| 5 | +# |
| 6 | +# This is a workflow for atomvm/atomvm_www to Publish atomvm.net documentation using GitHub Pages |
| 7 | + |
| 8 | +name: Build |
| 9 | + |
| 10 | +# Controls when the workflow will run |
| 11 | +on: |
| 12 | + # Triggers the workflow on push or pull request events but only for the master branch |
| 13 | + push: |
| 14 | + branches: [ "*" ] |
| 15 | + |
| 16 | + # Allows you to run this workflow manually from the Actions tab |
| 17 | + workflow_dispatch: |
| 18 | + |
| 19 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 20 | +jobs: |
| 21 | + # This workflow contains a single job called "build" |
| 22 | + build: |
| 23 | + # The type of runner that the job will run on |
| 24 | + runs-on: ubuntu-latest |
| 25 | + |
| 26 | + # Steps represent a sequence of tasks that will be executed as part of the job |
| 27 | + steps: |
| 28 | + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| 29 | + - uses: actions/checkout@v3 |
| 30 | + |
| 31 | + - uses: actions/cache@v1 |
| 32 | + id: gem-cache |
| 33 | + with: |
| 34 | + path: /home/runner/.local/share/gem |
| 35 | + key: ${{ runner.os }}-${{ hashFiles('**/gem-lockfiles') }} |
| 36 | + |
| 37 | + - name: Install Bundler |
| 38 | + if: steps.cache.outputs.gem-cache-hit != 'true' |
| 39 | + run: gem install bundler --user-install |
| 40 | + |
| 41 | + - uses: actions/cache@v1 |
| 42 | + id: bundler-cache |
| 43 | + with: |
| 44 | + path: /home/runner/.local/vendor/bundle |
| 45 | + key: ${{ runner.os }}-${{ hashFiles('**/bundler-lockfiles') }} |
| 46 | + |
| 47 | + - name: Install Bundler Deps |
| 48 | + if: steps.cache.outputs.bundler-cache-hit != 'true' |
| 49 | + run: | |
| 50 | + export PATH=${PATH}:/home/runner/.local/share/gem/ruby/3.2.0/bin |
| 51 | + /home/runner/.local/share/gem/ruby/3.2.0/bin/bundle config set --local path '/home/runner/.local/vendor/bundle' |
| 52 | + /home/runner/.local/share/gem/ruby/3.2.0/bin/bundle install |
| 53 | +
|
| 54 | + - uses: actions/checkout@v3 |
| 55 | + id: checkout-production |
| 56 | + with: |
| 57 | + repository: atomvm/atomvm_www |
| 58 | + ref: Production |
| 59 | + path: ./www |
| 60 | + |
| 61 | + - name: Build Site |
| 62 | + run: | |
| 63 | + /home/runner/.local/share/gem/ruby/3.2.0/bin/bundle exec jekyll build -d www |
| 64 | + touch www/.nojekyll |
| 65 | +
|
| 66 | + - name: Commit files |
| 67 | + working-directory: ./www |
| 68 | + run: | |
| 69 | + git checkout Production |
| 70 | + git branch --show-current |
| 71 | + git config --local user.email "[email protected]" |
| 72 | + git config --local user.name "AtomVM Doc Bot" |
| 73 | + git add . |
| 74 | + git commit -m "Update Documentation" |
0 commit comments