publish and setup with commands #187
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: genparker-pipeline | |
on: | |
push: | |
branches: | |
- 'main' | |
env: | |
BEFORE_SHA: ${{ github.event.before }} | |
DOCKER_ENVIRONMENT: 'latest' | |
RELEAF_UPLOAD_STORE_PASSWORD: ${{ secrets.RELEAF_UPLOAD_STORE_PASSWORD }} | |
RELEAF_UPLOAD_KEY_PASSWORD: ${{ secrets.RELEAF_UPLOAD_KEY_PASSWORD }} | |
jobs: | |
init: | |
runs-on: ubuntu-latest | |
outputs: | |
environment: ${{ steps.setvars.outputs.environment }} | |
branch: ${{ steps.setvars.outputs.branch }} | |
steps: | |
- name: Set variables | |
id: setvars | |
run: | | |
echo "::set-output name=environment::production" | |
echo "::set-output name=branch::main" | |
docker: | |
runs-on: ubuntu-latest | |
needs: init | |
steps: | |
- name: 'Build:checkout' | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: 'login' | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: npm-${{ hashFiles('package-lock.json') }} | |
restore-keys: npm- | |
- name: Install dependencies | |
run: npm i --ignore-scripts | |
- name: Install dependencies Mobile | |
run: cd apps/releaf/mobile && npm i --ignore-scripts | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'microsoft' | |
java-version: '17' | |
- name: Set up Android SDK | |
uses: android-actions/setup-android@v2 | |
with: | |
api-level: 34 | |
target: default | |
channel: stable | |
- name: publish affected | |
run: npx nx affected --target=publish --head=${{needs.init.outputs.branch}} --base=$BEFORE_SHA --configuration=${{needs.init.outputs.environment}} --parallel=5 | |
- name: 'cp for kustomize' | |
run: | | |
cp -r configs/genparker/base configs/genparker/overlay/philantropy/base & \ | |
cp configs/genparker/overlay/kustomization.yml configs/genparker/overlay/philantropy | |
- name: 'Kustomize Build' | |
uses: int128/kustomize-action@v1 | |
id: kustomize | |
with: | |
kustomization: 'overlay/*/kustomization.yml' | |
base-directory: 'configs/genparker' | |
- run: cp -r ${{ steps.kustomize.outputs.directory }} deployment_configs | |
- run: ls apps/releaf/mobile/android/app/build/outputs/bundle/release | |
- name: Update with kustomize | |
run: | | |
git add -A | |
git config --global user.name 'GenParker' | |
git config --global user.email '[email protected]' | |
git commit -am "Updating the project's structure" | |
git push -f origin main:deployment/philantropy |