Skip to content

Commit

Permalink
Merge pull request #13 from AyupDigital/feature/sc-4534/spin-up-h-f-s…
Browse files Browse the repository at this point in the history
…taging-instance

Not using docker images for composer and npm
  • Loading branch information
appsol authored Aug 8, 2024
2 parents bb5e378 + fccdcf5 commit 6b4bb5e
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ jobs:
package-lock.json
webpack.mix.js
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 16.20

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: composer:v2

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand All @@ -60,20 +71,14 @@ jobs:
DOCKER_USER: ${{secrets.DOCKER_USER}}
DOCKER_PWD: ${{secrets.DOCKER_PWD}}

- name: Build initial image to use to install composer dependencies
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{env.ECR_REPOSITORY}}
run: docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:latest docker/app/

- name: Install composer dependencies
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{env.ECR_REPOSITORY}}
run: docker run --rm --volume $PWD:/var/www/html -e COMPOSER_MEMORY_LIMIT=-1 $ECR_REGISTRY/$ECR_REPOSITORY:latest composer install --no-dev --optimize-autoloader
run: composer install --no-dev --optimize-autoloader --no-interaction

- name: Install NPM dependencies
run: docker run --rm --volume $PWD:/var/www/html -w /var/www/html node:16.20 npm ci && npm run prod && rm -rf node_modules
run: |
npm ci
npm run prod
rm -rf node_modules
- name: Copy completed app to packaged ready for final build
shell: bash
Expand Down

0 comments on commit 6b4bb5e

Please sign in to comment.