Updated reqVariable to requiredVariable #13
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
# This is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
pull_request: | |
branches: [ master ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build-and-deploy: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Setup java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '11' | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Build with Maven | |
run: mvn clean install | |
- if: (github.ref == 'refs/heads/master') && github.event_name == 'push' | |
name: Setup SSH | |
uses: kielabokkie/ssh-key-and-known-hosts-action@v1 | |
with: | |
# Private key required to access the host | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
# Hostname or IP to add to the known hosts file | |
ssh-host: ${{ secrets.ROBOSTAR_WEB_HOST }} | |
- if: (github.ref == 'refs/heads/master') && github.event_name == 'push' | |
name: Making upload.sh executable | |
run: chmod +x upload.sh | |
# If branch is 'master' and not a pull request, then upload. | |
- if: (github.ref == 'refs/heads/master') && github.event_name == 'push' | |
name: Uploading update site | |
run: ./upload.sh | |
env: | |
ROBOSTAR_WEB_ROOT: ${{ secrets.ROBOSTAR_WEB_ROOT }} | |
ROBOSTAR_WEB_USER: ${{ secrets.ROBOSTAR_WEB_USER }} | |
ROBOSTAR_WEB_HOST: ${{ secrets.ROBOSTAR_WEB_HOST }} | |
# For commits to master other than pull requests, send RoboTool email updates. | |
# - if: (github.ref == 'refs/heads/master') && github.event_name = 'push' | |
# name: Send email update | |
# run: ./send_emails.sh | |
# env: | |
# MAILCHIMPKEY: ${{ secrets.MAILCHIMPKEY }} | |
# MAILCHIMPUSR: ${{ secrets.MAILCHIMPUSR }} | |
- if: (github.ref == 'refs/heads/master') && github.event_name == 'push' | |
name: Recompile Textual Editor | |
run: | | |
# Propagate recompilation if global flag is active | |
if [[ -z ${ROBOSTAR_RECOMPILE_ALL} || ${ROBOSTAR_RECOMPILE_ALL} = false ]]; then | |
echo "Recompilation is disabled or not set." | |
else | |
curl -H "Authorization: token ${ROBOSTAR_GITHUB_ACTIONS_TOKEN}" \ | |
-X POST \ | |
-d '{"event_type":"rebuild"}' \ | |
https://api.github.com/repos/UoY-RoboStar/robosim-textual/dispatches | |
fi | |
env: | |
ROBOSTAR_RECOMPILE_ALL: ${{ secrets.ROBOSTAR_RECOMPILE_ALL }} | |
ROBOSTAR_GITHUB_ACTIONS_TOKEN: ${{ secrets.ROBOSTAR_GITHUB_ACTIONS_TOKEN }} | |
#- name: The job has failed | |
# if: failure() | |
# run: rm -rf /tmp/$GITHUB_RUN_NUMBER |