-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into show-hidden-steps
- Loading branch information
Showing
2 changed files
with
38 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# General notes on github actions: Note that both the working directory | ||
# and environment variables generally are not shared between steps. | ||
name: Deploy Hazel | ||
name: Build and Deploy Hazel | ||
on: [push] | ||
jobs: | ||
Deploy: | ||
|
@@ -10,39 +10,67 @@ jobs: | |
# and uncomment them to open an ssh connection at that point: | ||
#- name: Debugging with ssh | ||
# uses: lhotari/action-upterm@v1 | ||
- name: Checkout the hazel repo on the current branch # STEP 1 | ||
- name: Checkout the hazel repo on the current branch | ||
uses: actions/checkout@v2 | ||
with: | ||
path: source | ||
- name: Add the name of the current branch to the environment as BRANCH_NAME | ||
uses: nelonoel/[email protected] | ||
- name: Retrieve the build environment if cached # STEP 2 | ||
- name: Retrieve the build environment if cached | ||
id: opam-cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: '/home/runner/.opam/' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('./source/opam.export') }} | ||
- name: Install dependencies and build hazel # STEP 3 | ||
- name: Set-up OCaml | ||
run: | | ||
sudo apt --assume-yes install curl m4 opam | ||
export OPAMYES=1 | ||
opam init --compiler=ocaml-base-compiler.5.0.0 | ||
- name: Install dependencies | ||
run: | | ||
eval $(opam env) | ||
export OPAMYES=1 | ||
make deps | ||
working-directory: ./source | ||
- name: Build Hazel | ||
run: | | ||
eval $(opam env) | ||
make release | ||
working-directory: ./source | ||
- name: Checkout the website build artifacts repo # STEP 4 | ||
- name: Run Tests | ||
id: test | ||
continue-on-error: true | ||
run: | | ||
eval $(opam env) | ||
make test > test_output | ||
if [ $? -eq 0 ]; then | ||
echo "::set-output name=tests_passed::true" | ||
else | ||
echo "::set-output name=tests_passed::false" | ||
fi | ||
working-directory: ./source | ||
- uses: LouisBrunner/[email protected] | ||
if: always() | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
name: Test Results | ||
conclusion: ${{ steps.test.outputs.tests_passed == 'true' && 'success' || 'failure' }} | ||
output_text_description_file: ./source/test_output | ||
output: | | ||
{"summary":"${{ steps.test.outputs.tests_passed == 'true' && 'Tests Passed' || 'Tests Failed' }}"} | ||
- name: Checkout the website build artifacts repo | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: hazelgrove/build | ||
token: ${{ secrets.ACCESS_TOKEN }} | ||
path: server | ||
- name: Clear any old build of this branch # STEP 5 | ||
- name: Clear any old build of this branch | ||
run: if [ -d "${BRANCH_NAME}" ] ; then rm -rf "${BRANCH_NAME}" ; fi | ||
working-directory: ./server | ||
- name: Copy in the newly built source # STEP 6 | ||
- name: Copy in the newly built source | ||
run: mkdir "./server/${BRANCH_NAME}" && cp -r "./source/_build/default/src/haz3lweb/www"/* "./server/${BRANCH_NAME}" | ||
- name : Commit to the website aka deploy # STEP 7 | ||
- name : Commit to the website aka deploy | ||
run: | | ||
git config user.name github-deploy-action | ||
git config user.email [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters