-
-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (109 loc) · 5.47 KB
/
push-feature.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: mono-repo [push]
on:
workflow_dispatch:
push:
branches:
- 'feature/**'
- 'main'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
jobs:
EnvSetup:
name: Setup Dynamic Environment Variables
runs-on: ubuntu-latest
environment: Development
outputs:
#Name
NX_NAME: ${{ steps.set-output-defaults.outputs.NX_NAME}}
#Variant
NX_VARIANT: ${{ steps.set-output-defaults.outputs.NX_VARIANT}}
#Chrome Extension
NX_CHROME_EXTENSION_ID: ${{ steps.set-output-defaults.outputs.NX_CHROME_EXTENSION_ID}}
#Edge Extension
NX_EDGE_EXTENSION_ID: ${{ steps.set-output-defaults.outputs.NX_EDGE_EXTENSION_ID}}
#i18n
NX_I18N: ${{steps.set-output-defaults.outputs.NX_I18N}}
#Google Analytics
NX_GOOGLE_ANALYTICS_ID: ${{steps.set-output-defaults.outputs.NX_GOOGLE_ANALYTICS_ID}}
#Google Adsense
NX_GOOGLE_ADS_SLOT: ${{steps.set-output-defaults.outputs.NX_GOOGLE_ADS_SLOT}}
NX_GOOGLE_ADS_CLIENT: ${{steps.set-output-defaults.outputs.NX_GOOGLE_ADS_CLIENT}}
# Public URL
PUBLIC_URL: ${{ steps.set-output-defaults.outputs.PUBLIC_URL}}
# Extension
UNINSTALL_URL: ${{ steps.set-output-defaults.outputs.UNINSTALL_URL}}
TRACKING_ID: ${{ steps.set-output-defaults.outputs.TRACKING_ID}}
FUNCTION_URL: ${{ steps.set-output-defaults.outputs.FUNCTION_URL}}
DISCORD_CLIENT_ID: ${{ steps.set-output-defaults.outputs.DISCORD_CLIENT_ID}}
OAUTH_CLIENT_ID: ${{ steps.set-output-defaults.outputs.OAUTH_CLIENT_ID}}
steps:
- name: set outputs with default values
id: set-output-defaults
run: |
echo "NX_NAME=${{ vars.NX_NAME }}" >> $GITHUB_OUTPUT
echo "NX_VARIANT=${{ vars.NX_VARIANT }}" >> $GITHUB_OUTPUT
echo "NX_CHROME_EXTENSION_ID=${{ vars.NX_CHROME_EXTENSION_ID }}" >> $GITHUB_OUTPUT
echo "NX_EDGE_EXTENSION_ID=${{ vars.NX_EDGE_EXTENSION_ID || 'DEV' }}" >> $GITHUB_OUTPUT
echo "NX_I18N=${{ vars.NX_I18N }}" >> $GITHUB_OUTPUT
echo "NX_GOOGLE_ANALYTICS_ID=${{ vars.NX_GOOGLE_ANALYTICS_ID }}" >> $GITHUB_OUTPUT
echo "NX_GOOGLE_ADS_SLOT=${{ vars.NX_GOOGLE_ADS_SLOT }}" >> $GITHUB_OUTPUT
echo "NX_GOOGLE_ADS_CLIENT=${{ vars.NX_GOOGLE_ADS_CLIENT }}" >> $GITHUB_OUTPUT
echo "UNINSTALL_URL=${{ vars.UNINSTALL_URL }}" >> $GITHUB_OUTPUT
echo "TRACKING_ID=${{ vars.TRACKING_ID }}" >> $GITHUB_OUTPUT
echo "FUNCTION_URL=${{ vars.FUNCTION_URL }}" >> $GITHUB_OUTPUT
echo "DISCORD_CLIENT_ID='${{ vars.DISCORD_CLIENT_ID }}'" >> $GITHUB_OUTPUT
echo "OAUTH_CLIENT_ID=${{ vars.OAUTH_CLIENT_ID }}" >> $GITHUB_OUTPUT
echo "PUBLIC_URL=${{ vars.PUBLIC_URL }}" >> $GITHUB_OUTPUT
main:
needs: [EnvSetup]
name: Nx Cloud - Main Job
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.13.0
secrets:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
with:
parallel-commands: |
npx nx-cloud record -- npx nx format:check
environment-variables: |
NX_NAME=${{needs.EnvSetup.outputs.NX_NAME}}
NX_VARIANT=${{needs.EnvSetup.outputs.NX_VARIANT}}
NX_CHROME_EXTENSION_ID=${{needs.EnvSetup.outputs.NX_CHROME_EXTENSION_ID}}
NX_EDGE_EXTENSION_ID=${{needs.EnvSetup.outputs.NX_EDGE_EXTENSION_ID}}
NX_I18N=${{needs.EnvSetup.outputs.NX_I18N}}
NX_GOOGLE_ANALYTICS_ID=${{needs.EnvSetup.outputs.NX_GOOGLE_ANALYTICS_ID}}
NX_GOOGLE_ADS_SLOT=${{needs.EnvSetup.outputs.NX_GOOGLE_ADS_SLOT}}
NX_GOOGLE_ADS_CLIENT=${{needs.EnvSetup.outputs.NX_GOOGLE_ADS_CLIENT}}
UNINSTALL_URL=${{needs.EnvSetup.outputs.UNINSTALL_URL}}
TRACKING_ID=${{needs.EnvSetup.outputs.TRACKING_ID}}
FUNCTION_URL=${{needs.EnvSetup.outputs.FUNCTION_URL}}
DISCORD_CLIENT_ID=${{needs.EnvSetup.outputs.DISCORD_CLIENT_ID}}
OAUTH_CLIENT_ID=${{needs.EnvSetup.outputs.OAUTH_CLIENT_ID}}
PUBLIC_URL=${{needs.EnvSetup.outputs.PUBLIC_URL}}
parallel-commands-on-agents: |
npx nx affected --target=lint --parallel=3
npx nx affected --target=test --parallel=3 --exclude='tag:puppeteer' --ci --code-coverage
agents:
needs: [EnvSetup]
name: Nx Cloud - Agents
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.13.0
secrets:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
with:
number-of-agents: 3
environment-variables: |
NX_NAME=${{needs.EnvSetup.outputs.NX_NAME}}
NX_VARIANT=${{needs.EnvSetup.outputs.NX_VARIANT}}
NX_CHROME_EXTENSION_ID=${{needs.EnvSetup.outputs.NX_CHROME_EXTENSION_ID}}
NX_EDGE_EXTENSION_ID=${{needs.EnvSetup.outputs.NX_EDGE_EXTENSION_ID}}
NX_I18N=${{needs.EnvSetup.outputs.NX_I18N}}
NX_GOOGLE_ANALYTICS_ID=${{needs.EnvSetup.outputs.NX_GOOGLE_ANALYTICS_ID}}
NX_GOOGLE_ADS_SLOT=${{needs.EnvSetup.outputs.NX_GOOGLE_ADS_SLOT}}
NX_GOOGLE_ADS_CLIENT=${{needs.EnvSetup.outputs.NX_GOOGLE_ADS_CLIENT}}
UNINSTALL_URL=${{needs.EnvSetup.outputs.UNINSTALL_URL}}
TRACKING_ID=${{needs.EnvSetup.outputs.TRACKING_ID}}
FUNCTION_URL=${{needs.EnvSetup.outputs.FUNCTION_URL}}
DISCORD_CLIENT_ID=${{needs.EnvSetup.outputs.DISCORD_CLIENT_ID}}
OAUTH_CLIENT_ID=${{needs.EnvSetup.outputs.OAUTH_CLIENT_ID}}
PUBLIC_URL=${{needs.EnvSetup.outputs.PUBLIC_URL}}