-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: andrei-zgirvaci <[email protected]>
- Loading branch information
1 parent
4539962
commit f15994b
Showing
1 changed file
with
79 additions
and
34 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,101 @@ | ||
name: Distribute Sample App to App Center | ||
name: Distribute Sample App to App Center & Build Docs | ||
|
||
on: | ||
push: | ||
branches: [main, ci] | ||
branches: [main, ci, documentation] | ||
|
||
jobs: | ||
build-and-deploy-sample-app: | ||
env: | ||
SAMPLE_APP_PATH: 'apps/sample-app/android' | ||
# build-and-deploy-sample-app: | ||
# env: | ||
# SAMPLE_APP_PATH: 'apps/sample-app/android' | ||
|
||
# runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - name: Checkout repository | ||
# uses: actions/checkout@v4 | ||
|
||
# - name: Setup Bun | ||
# uses: oven-sh/setup-bun@v1 | ||
# with: | ||
# bun-version: latest | ||
|
||
# - name: Install dependencies | ||
# run: bun install | ||
|
||
# - name: Setup JDK | ||
# uses: actions/setup-java@v4 | ||
# with: | ||
# distribution: 'zulu' | ||
# java-version: '17' | ||
|
||
# - name: Add secrets to `local.properties` | ||
# run: | | ||
# echo GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties && | ||
# echo FACEBOOK_APP_ID=${{ secrets.FACEBOOK_APP_ID }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties && | ||
# echo FACEBOOK_CLIENT_TOKEN=${{ secrets.FACEBOOK_CLIENT_TOKEN }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties && | ||
# echo DROPBOX_APP_KEY=${{ secrets.DROPBOX_APP_KEY }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties && | ||
# echo MICROSOFT_CLIENT_ID=${{ secrets.MICROSOFT_CLIENT_ID }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties && | ||
# echo MICROSOFT_HOST_PATH=com.openmobilehub.reactnative.auth.sample.MainApplication >> ${{ env.SAMPLE_APP_PATH }}/local.properties && | ||
# echo MICROSOFT_SIGNATURE_HASH=${{ secrets.MICROSOFT_SIGNATURE_HASH }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties | ||
|
||
# - name: Build release | ||
# run: | | ||
# cd ${{ env.SAMPLE_APP_PATH }} | ||
# ./gradlew assembleRelease | ||
|
||
# - name: Upload .apk to App Center | ||
# uses: wzieba/AppCenter-Github-Action@v1 | ||
# with: | ||
# appName: Callstack-dev/React-Native-Auth-Sample-App | ||
# group: Testers | ||
# token: ${{ secrets.APP_CENTER_TOKEN }} | ||
# file: ${{ env.SAMPLE_APP_PATH }}/app/build/outputs/apk/release/app-release.apk | ||
# notifyTesters: true | ||
# debug: true | ||
# gitReleaseNotes: true | ||
|
||
build-docs: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Bun | ||
-- name: Setup Bun | ||
uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: latest | ||
|
||
- name: Install dependencies | ||
run: bun install | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
- name: Build docs | ||
run: | | ||
cd docs | ||
bun build | ||
|
||
- name: Upload Build Artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '17' | ||
path: build | ||
|
||
- name: Add secrets to `local.properties` | ||
run: | | ||
echo GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties && | ||
echo FACEBOOK_APP_ID=${{ secrets.FACEBOOK_APP_ID }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties && | ||
echo FACEBOOK_CLIENT_TOKEN=${{ secrets.FACEBOOK_CLIENT_TOKEN }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties && | ||
echo DROPBOX_APP_KEY=${{ secrets.DROPBOX_APP_KEY }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties && | ||
echo MICROSOFT_CLIENT_ID=${{ secrets.MICROSOFT_CLIENT_ID }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties && | ||
echo MICROSOFT_HOST_PATH=com.openmobilehub.reactnative.auth.sample.MainApplication >> ${{ env.SAMPLE_APP_PATH }}/local.properties && | ||
echo MICROSOFT_SIGNATURE_HASH=${{ secrets.MICROSOFT_SIGNATURE_HASH }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties | ||
- name: Build release | ||
run: | | ||
cd ${{ env.SAMPLE_APP_PATH }} | ||
./gradlew assembleRelease | ||
deploy-docs: | ||
needs: build-docs | ||
|
||
- name: Upload .apk to App Center | ||
uses: wzieba/AppCenter-Github-Action@v1 | ||
with: | ||
appName: Callstack-dev/React-Native-Auth-Sample-App | ||
group: Testers | ||
token: ${{ secrets.APP_CENTER_TOKEN }} | ||
file: ${{ env.SAMPLE_APP_PATH }}/app/build/outputs/apk/release/app-release.apk | ||
notifyTesters: true | ||
debug: true | ||
gitReleaseNotes: true | ||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | ||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
|
||
# Deploy to the github-pages environment | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |