build #7
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: Build | |
on: | |
repository_dispatch: | |
types: [build] | |
env: | |
ALLOWED_REPOS: >- | |
[ | |
"cover-router", | |
"dummy-app" | |
"frontend-next", | |
"frontend-react", | |
] | |
ALLOWED_BRANCHES: '["dev", "master"]' | |
TARGET_REPO: ${{ github.event.client_payload.repo || 'none' }} | |
TARGET_BRANCH: ${{ github.event.client_payload.branch || 'none' }} | |
jobs: | |
checks: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 5 | |
steps: | |
- name: Print env | |
run: bash -c set | |
- name: Print allowed repos | |
run: 'echo Allowed repos: ${{ env.ALLOWED_REPOS }}' | |
- name: Check repos | |
if: ${{ contains(fromJSON(env.ALLOWED_REPOS), env.TARGET_REPO) }} | |
run: echo OK | |
- name: Check branch | |
if: ${{ contains(fromJSON(env.ALLOWED_BRANCHES), env.TARGET_BRANCH) }} | |
run: echo OK | |
build: | |
runs-on: ubuntu-22.04 | |
environment: production | |
needs: checks | |
timeout-minutes: 5 | |
steps: | |
- name: Create deployooor app token | |
uses: actions/create-github-app-token@v1 | |
id: app-token | |
with: | |
app-id: ${{ vars.DEPLOYER_APP_ID }} | |
private-key: ${{ secrets.DEPLOYER_APP_PK }} | |
owner: ${{ github.repository_owner }} | |
repositories: | | |
${{ env.TARGET_REPO }} | |
argocd | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ env.TARGET_REPO }} | |
ref: ${{ env.TARGET_BRANCH }} | |
path: code | |
- name: ls | |
run: ls -la code |