Deploy to Production by @dharmesh-hemaram on main #4
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: mono-repo [deploy - configs] | |
run-name: Deploy to Production by @${{ github.actor }} on ${{github.ref_name }} | |
on: | |
workflow_dispatch: | |
jobs: | |
main: | |
name: Build & Bundle | |
environment: Production | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
actions: read | |
discussions: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: https://npm.pkg.github.com | |
scope: ${{github.repository_owner}} | |
cache: 'npm' | |
- uses: nrwl/nx-set-shas@v3 | |
- run: | | |
echo "BASE: ${{ env.NX_BASE }}" | |
echo "HEAD: ${{ env.NX_HEAD }}" | |
- run: npm ci | |
- name: Build Projects and Library | |
run: npx nx build acf-configs --prod --verbose | |
env: | |
NX_PUBLIC_NAME: ${{vars.NX_PUBLIC_NAME}} | |
NX_PUBLIC_VARIANT: ${{vars.NX_PUBLIC_VARIANT}} | |
NX_PUBLIC_CHROME_EXTENSION_ID: ${{vars.NX_PUBLIC_CHROME_EXTENSION_ID}} | |
NX_PUBLIC_EDGE_EXTENSION_ID: ${{vars.NX_PUBLIC_EDGE_EXTENSION_ID || 'DEV'}} | |
NX_PUBLIC_I18N: ${{vars.NX_PUBLIC_I18N}} | |
NX_PUBLIC_GOOGLE_ANALYTICS_ID: ${{vars.NX_PUBLIC_GOOGLE_ANALYTICS_ID}} | |
NX_PUBLIC_GOOGLE_ADS_SLOT: ${{vars.NX_PUBLIC_GOOGLE_ADS_SLOT}} | |
NX_PUBLIC_GOOGLE_ADS_CLIENT: ${{vars.NX_PUBLIC_GOOGLE_ADS_CLIENT}} | |
NX_PUBLIC_FIREBASE_API_KEY: ${{vars.NX_PUBLIC_FIREBASE_API_KEY}} | |
NX_PUBLIC_FIREBASE_DATABASE_URL: ${{vars.NX_PUBLIC_FIREBASE_DATABASE_URL}} | |
NX_PUBLIC_FIREBASE_PROJECT_ID: ${{vars.NX_PUBLIC_FIREBASE_PROJECT_ID}} | |
NX_PUBLIC_FIREBASE_BUCKET: ${{vars.NX_PUBLIC_FIREBASE_BUCKET}} | |
UNINSTALL_URL: ${{vars.UNINSTALL_URL}} | |
TRACKING_ID: ${{vars.TRACKING_ID}} | |
FUNCTION_URL: ${{vars.FUNCTION_URL}} | |
DISCORD_CLIENT_ID: ${{vars.DISCORD_CLIENT_ID}} | |
OAUTH_CLIENT_ID: ${{vars.OAUTH_CLIENT_ID}} | |
EDGE_OAUTH_CLIENT_ID: ${{vars.EDGE_OAUTH_CLIENT_ID}} | |
PUBLIC_URL: ${{vars.PUBLIC_URL}} | |
NX_PUBLIC_RELEASE_VERSION: ${{inputs.version || github.ref_name}} | |
API_SECRET: ${{vars.API_SECRET}} | |
MEASUREMENT_ID: ${{vars.MEASUREMENT_ID}} | |
- name: Print Environment Info | |
run: npx nx report | |
- name: Bundle Projects | |
run: | | |
mkdir bundle | |
cd dist/apps/acf-configs | |
zip -r ../../../bundle/acf-configs-${{vars.NX_PUBLIC_VARIANT}}.zip . | |
cd .. | |
- uses: actions/upload-artifact@v4 | |
id: artifact-upload-step | |
with: | |
name: nx-main-artifacts | |
path: | | |
bundle/* | |
firebase.json | |
.firebaserc | |
config: | |
name: Deploy Config | |
needs: [main] | |
permissions: | |
contents: read | |
pull-requests: write | |
runs-on: ubuntu-latest | |
environment: | |
name: Production | |
url: ${{vars.PUBLIC_URL}} | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: nx-main-artifacts | |
- name: unzip | |
run: unzip bundle/acf-configs-${{vars.NX_PUBLIC_VARIANT}}.zip -d acf-configs | |
- name: Files | |
run: ls -la | |
- name: Build And Deploy | |
id: deploy | |
uses: FirebaseExtended/action-hosting-deploy@v0 | |
with: | |
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}' | |
projectId: auto-clicker-autofill | |
channelId: live |