Add yarn #84
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
name: Trigger CircleCI Build | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
jobs: | |
trigger-circleci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Determine environment and branch | |
id: env-branch | |
run: | | |
if [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then | |
echo "::set-output name=environment::development" | |
echo "::set-output name=branch::dev" | |
else | |
echo "::set-output name=environment::production" | |
echo "::set-output name=branch::main" | |
fi | |
- name: Ensure repository is dashboard-runner | |
run: | | |
REPO_NAME=$(basename -s .git `git config --get remote.origin.url`) | |
if [ "$REPO_NAME" != "dashboard-runner" ]; then | |
echo "This action is only allowed to run in the earthfast/dashboard-runner repository." | |
exit 0 | |
fi | |
- name: Trigger CircleCI Pipeline | |
run: | | |
curl -X POST \ | |
-H "Circle-Token: ${{ secrets.CIRCLECI_API_TOKEN }}" \ | |
-H "Content-Type: application/json" \ | |
-d '{ | |
"branch": "${{ steps.env-branch.outputs.branch }}", | |
"parameters": { | |
"SOURCE_TYPE": "github", | |
"S3_URL": "", | |
"REPOSITORY": "https://github.com/cheran-senthil/cheran-senthil.github.io", | |
"BUILD_DIR": ".", | |
"PACKAGE_INSTALL_COMMAND": "ls", | |
"BUILD_COMMAND": "ls", | |
"OUTPUT_DIR": ".", | |
"ENVIRONMENT_VARIABLES": "", | |
"ONE_CLICK_SERVER_URL": "https://jorge.ngrok.pro", | |
"ENVIRONMENT": "${{ steps.env-branch.outputs.environment }}", | |
"CI_TRIGGER": true | |
} | |
}' \ | |
https://circleci.com/api/v2/project/gh/earthfast/dashboard-runner/pipeline | |
env: | |
CIRCLECI_API_TOKEN: ${{ secrets.CIRCLECI_API_TOKEN }} |