diff --git a/.github/workflows/branch-deploys.yml b/.github/workflows/branch-deploys.yml new file mode 100644 index 0000000..5d3df5d --- /dev/null +++ b/.github/workflows/branch-deploys.yml @@ -0,0 +1,52 @@ +name: Branch Deploys for Netlify + +on: + pull_request: + branches: + - next + types: + - closed + push: + branches: + - next + paths: + - "netlify/functions/**/*.*" + - "src/**/*.*" + - "lib/**/*.*" + - "netlify.toml" + +jobs: + build_and_deploy: + name: Build and deploy to Netlify + runs-on: ubuntu-22.04 + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: package.json + - name: Install PNPM + run: npm install -g pnpm + - name: Get Store Path + id: get-store-path + run: echo "store-path=$(pnpm store path)\n" >> $GITHUB_OUTPUT + - name: Setup Cache + id: setup-cache + uses: actions/cache@v4 + with: + key: ${{ runner.os }}-${{ hashFiles('**/*lock*', 'package.json') }} + restore-keys: | + ${{ runner.os }}-${{ hashFiles('**/*lock*', 'package.json') }} + ${{ runner.os }}- + path: | + node_modules + ${{ steps.get-store-path.outputs.store-path }} + - name: Install Dependencies 📦 + if: steps.setup-cache.outputs.cache-hit != 'true' + run: pnpm i + - name: Build ⚙️ & Deploy ⬆️ + run: netlify deploy --alias="${{ github.ref_name }}" --build --context deploy-preview --message="${{ github.event.head_commit.message }}" diff --git a/README.md b/README.md index a203799..84209dc 100644 --- a/README.md +++ b/README.md @@ -1,59 +1,4 @@ -# Tellme +# TellThem +[![Netlify Status](https://api.netlify.com/api/v1/badges/bbed7679-1ffd-4dad-ad22-80a6a531474d/deploy-status)](https://app.netlify.com/sites/tellthem/deploys) -This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.6. - -## Development server - -To start a local development server, run: - -```bash -ng serve -``` - -Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files. - -## Code scaffolding - -Angular CLI includes powerful code scaffolding tools. To generate a new component, run: - -```bash -ng generate component component-name -``` - -For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run: - -```bash -ng generate --help -``` - -## Building - -To build the project run: - -```bash -ng build -``` - -This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed. - -## Running unit tests - -To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command: - -```bash -ng test -``` - -## Running end-to-end tests - -For end-to-end (e2e) testing, run: - -```bash -ng e2e -``` - -Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs. - -## Additional Resources - -For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page. +A social media status marketing platform. diff --git a/angular.json b/angular.json index 694c258..72dd3c5 100644 --- a/angular.json +++ b/angular.json @@ -83,6 +83,14 @@ } ] }, + "staging": { + "fileReplacements": [ + { + "replace": "src/environments/environment.development.ts", + "with": "src/environments/environment.staging.ts" + } + ] + }, "development": { "optimization": false, "extractLicenses": false, diff --git a/netlify/functions/auth/index.ts b/netlify/functions/auth/index.ts index 10da6cb..984f2e6 100644 --- a/netlify/functions/auth/index.ts +++ b/netlify/functions/auth/index.ts @@ -73,16 +73,13 @@ passport.deserializeUser((id, done) => { }); const router = Router(); -router.get('/', (req,res,next) => { - console.debug(process.env['URL']); - passport.authenticate('google', { - session: false, - scope: [ - 'profile', - 'email', - ] - })(req,res,next); -}); +router.get('/', passport.authenticate('google', { + session: false, + scope: [ + 'profile', + 'email', + ] +})); router.get('/callback', passport.authenticate('google', { failureRedirect: '/auth/login', session: false, }), (req: Request, res: Response) => { diff --git a/qodana.yaml b/qodana.yaml index a8cb557..2703b8c 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -2,5 +2,5 @@ version: "1.0" linter: jetbrains/qodana-js:2024.2 profile: name: qodana.recommended -include: - - name: CheckDependencyLicenses \ No newline at end of file +exclude: + - name: AngularNonStandaloneComponentImports diff --git a/src/environments/environment.staging.ts b/src/environments/environment.staging.ts new file mode 100644 index 0000000..6f90a84 --- /dev/null +++ b/src/environments/environment.staging.ts @@ -0,0 +1,3 @@ +export const environment = { + apiOrigin: location.origin +};