Skip to content

Commit 6c65100

Browse files
committed
Add Build test for all branches
Adds a build test for pull requests. Signed-off-by: Winford <[email protected]>
1 parent 3f0cbdf commit 6c65100

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

.github/workflows/build.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
pull:
14+
branches: [ "*" ]
15+
push:
16+
branches: [ "*" ]
17+
18+
# Allows you to run this workflow manually from the Actions tab
19+
workflow_dispatch:
20+
21+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
22+
jobs:
23+
# This workflow contains a single job called "build"
24+
build:
25+
# The type of runner that the job will run on
26+
runs-on: ubuntu-latest
27+
28+
# Steps represent a sequence of tasks that will be executed as part of the job
29+
steps:
30+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
31+
- uses: actions/checkout@v3
32+
33+
- uses: actions/cache@v1
34+
id: gem-cache
35+
with:
36+
path: /home/runner/.local/share/gem
37+
key: ${{ runner.os }}-${{ hashFiles('**/gem-lockfiles') }}
38+
39+
- name: Install Bundler
40+
if: steps.cache.outputs.gem-cache-hit != 'true'
41+
run: gem install bundler --user-install
42+
43+
- uses: actions/cache@v1
44+
id: bundler-cache
45+
with:
46+
path: /home/runner/.local/vendor/bundle
47+
key: ${{ runner.os }}-${{ hashFiles('**/bundler-lockfiles') }}
48+
49+
- name: Install Bundler Deps
50+
if: steps.cache.outputs.bundler-cache-hit != 'true'
51+
run: |
52+
export PATH=${PATH}:/home/runner/.local/share/gem/ruby/3.2.0/bin
53+
/home/runner/.local/share/gem/ruby/3.2.0/bin/bundle config set --local path '/home/runner/.local/vendor/bundle'
54+
/home/runner/.local/share/gem/ruby/3.2.0/bin/bundle install
55+
56+
- uses: actions/checkout@v3
57+
id: checkout-production
58+
with:
59+
repository: atomvm/atomvm_www
60+
ref: Production
61+
path: ./www
62+
63+
- name: Build Site
64+
run: |
65+
/home/runner/.local/share/gem/ruby/3.2.0/bin/bundle exec jekyll build -d www
66+
touch www/.nojekyll
67+
68+
- name: Commit files
69+
working-directory: ./www
70+
run: |
71+
git checkout Production
72+
git branch --show-current
73+
git config --local user.email "[email protected]"
74+
git config --local user.name "AtomVM Doc Bot"
75+
git add .
76+
git commit -m "Update Documentation"

0 commit comments

Comments
 (0)