Files
cbsnexora-backend/.github/workflows/fineract.dev.yaml
T
naveensrinivasanandAleksandar Vidakovic e088e4d70d chore: Set permissions for GitHub actions
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2022-04-21 13:46:58 +02:00

46 lines
1.3 KiB
YAML

# This is the GitHub Action which
# automatically updates https://www.fineract.dev
#
# see https://jira.apache.org/jira/browse/FINERACT-970
# https://github.com/marketplace/actions/setup-gcloud-environment
# and http://blog2.vorburger.ch/2020/05/fineractdev-cicd-from-github-to-google.html
#
# Created by Michael Vorburger.ch for Fineract in May 2020.
#
name: Deploy to https://www.fineract.dev
on:
push:
branches:
- develop
permissions:
contents: read
jobs:
setup-build-deploy:
name: Deploy on Fineract.dev
if: github.repository == 'apache/fineract'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: 'auth'
uses: google-github-actions/auth@v0
with:
credentials_json: '${{ secrets.GOOGLE_APPLICATION_CREDENTIALS}}'
- uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GOOGLE_PROJECT_ID }}
- run: gcloud components install beta
- run: JOBS=$(gcloud beta builds list --ongoing --format="value[terminator=' '](id)") && [ ! -z "$JOBS" ] && echo "Cancelling $JOBS..." && gcloud builds cancel $JOBS --no-user-output-enabled || true
- run: gcloud beta builds triggers list
- run: gcloud beta builds triggers run deploy-demo --branch=master