Skip to content

Commit

Permalink
Move asset compilation step to deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffmueller-st committed Sep 16, 2024
1 parent 369bd67 commit 179ec82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/deploy_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@ jobs:
- uses: actions/checkout@v4
- name: Composer install
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: NPM Install
uses: actions/setup-node@v3
with:
node-version: 12.14
- name: NPM Setup
run: |
npm install
npm run dev
- name: Deploy to Prod
uses: deployphp/action@v1
with:
Expand All @@ -72,14 +64,6 @@ jobs:
- uses: actions/checkout@v4
- name: Composer install
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: NPM Install
uses: actions/setup-node@v3
with:
node-version: 12.14
- name: NPM Setup
run: |
npm install
npm run dev
- name: Deploy to Dev
uses: deployphp/action@v1
with:
Expand Down
9 changes: 9 additions & 0 deletions deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
upload('.env', get('deploy_path') . '/shared');
});

task('build', function() {
$stage = null;
if (input()->hasArgument('stage')) {
$stage = input()->getArgument('stage');
}
run("npm ci && npm run $stage");
});

host('snaccooperative.org')
->set('hostname', 'snaccooperative.org')
->set('labels', ['env' => 'production', 'stage' => 'production'])
Expand Down Expand Up @@ -68,4 +76,5 @@
'artisan:queue:restart',
'deploy:symlink',
'deploy:cleanup',
'build'
]);

0 comments on commit 179ec82

Please sign in to comment.