Difference between revisions of "Github Actions"
Jump to navigation
Jump to search
Line 11: | Line 11: | ||
# Secrets | # Secrets | ||
- https://bloggie.io/@_junrong/using-environment-variables-secrets-in-github-actions | - https://bloggie.io/@_junrong/using-environment-variables-secrets-in-github-actions | ||
+ | |||
+ | run-unit-test.yml | ||
+ | ``` | ||
+ | name: Example Request & Master CI | ||
+ | |||
+ | on: | ||
+ | pull_request: | ||
+ | branches: | ||
+ | - 'master' | ||
+ | push: | ||
+ | branches: | ||
+ | - 'master' | ||
+ | jobs: | ||
+ | test: | ||
+ | name: Run Unit Tests | ||
+ | runs-on: ubuntu-18.04 | ||
+ | |||
+ | steps: | ||
+ | - uses: actions/checkout@v1 | ||
+ | - name: setup JDK 1.8 | ||
+ | uses: actions/setup-java@v1 | ||
+ | with: | ||
+ | java-version: 1.8 | ||
+ | - name: Run Unit tests | ||
+ | + env: | ||
+ | + FIXER_IO_ACCESS_TOKEN: ${{ secrets.FIXER_IO_ACCESS_TOKEN }} | ||
+ | + BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} | ||
+ | + run: ./gradlew test -Parg1=$FIXER_IO_ACCESS_TOKEN -Parg2=$BOT_GITHUB_TOKEN | ||
+ | ``` |
Revision as of 02:18, 24 November 2020
Self Hosted runner
- https://github.com/jeremybusk/test-githubactions/settings/actions/add-new-runner?arch=x64&os=linux
- https://docs.github.com/en/free-pro-team@latest/actions/hosting-your-own-runners/adding-self-hosted-runners#:~:text=On%20GitHub%2C%20navigate%20to%20the,runners%2C%22%20click%20Add%20runner.
- https://docs.github.com/en/free-pro-team@latest/actions/hosting-your-own-runners/using-self-hosted-runners-in-a-workflow
- https://github.com/jeremybusk/test-githubactions/actions
- https://docs.github.com/en/free-pro-team@latest/actions/hosting-your-own-runners/configuring-the-self-hosted-runner-application-as-a-service
- https://docs.github.com/en/free-pro-team@latest/actions/hosting-your-own-runners/configuring-the-self-hosted-runner-application-as-a-service
Secrets
run-unit-test.yml
name: Example Request & Master CI on: pull_request: branches: - 'master' push: branches: - 'master' jobs: test: name: Run Unit Tests runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v1 - name: setup JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Run Unit tests + env: + FIXER_IO_ACCESS_TOKEN: ${{ secrets.FIXER_IO_ACCESS_TOKEN }} + BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} + run: ./gradlew test -Parg1=$FIXER_IO_ACCESS_TOKEN -Parg2=$BOT_GITHUB_TOKEN