diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..9ce744e --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,43 @@ +name: Deploy (Development) + +on: + pull_request: + branches: [ release ] + + workflow_dispatch: + +jobs: + dev: + environment: dev + runs-on: ubuntu-latest + permissions: + id-token: write # This is required for requesting the OIDC JWT Token + contents: read # Required when GH token is used to authenticate with private repo + + steps: + - name: Checkout to the branch + uses: actions/checkout@v2 + + - name: Azure Login + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + # TODO: add test step + + - name: Build and Deploy + uses: azure/container-apps-deploy-action@v2 + with: + appSourcePath: ${{ github.workspace }} + dockerfilePath: ./Dockerfile + registryUrl: plurish.azurecr.io + registryUsername: ${{ secrets.REGISTRY_USERNAME }} + registryPassword: ${{ secrets.REGISTRY_PASSWORD }} + containerAppName: dev-capp-plurish-web + resourceGroup: dev-rg-plurish + imageToBuild: plurish.azurecr.io/ui:${{ github.sha }} + targetPort: 8000 + _buildArgumentsKey_: | + _buildArgumentsValues_ + + # TODO: add hml stage \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index a09028d..4d46056 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -14,13 +14,13 @@ "name": "Start", "request": "launch", "preLaunchTask": "compose-up", - "type": "node" + "type": "node" }, - { + { "name": "Stop", "request": "launch", "preLaunchTask": "compose-down", - "type": "node" + "type": "node" }, ], "compounds": [ diff --git a/Dockerfile b/Dockerfile index e843e60..96a2ed5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,9 @@ FROM plurish/server:latest +ENV APP_ENV=prod + RUN apt-get install -y --no-install-recommends vim & \ - npm i -g yarn & \ - pecl install xdebug && docker-php-ext-enable xdebug + npm i -g yarn WORKDIR /var/www @@ -13,10 +14,10 @@ RUN chmod 777 /var/www /var/www/yarn.lock /var/www/public USER dev # Installing dependencies -RUN composer install & yarn -RUN composer clear-cache & yarn cache clean +RUN composer install --no-dev --optimize-autoloader & yarn +RUN yarn build # Starting the app -COPY ./xdebug.ini "${PHP_INI_DIR}/conf.d" +EXPOSE 8000 -CMD ["bash", "./init.sh"] \ No newline at end of file +ENTRYPOINT ["symfony", "server:start"] \ No newline at end of file diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000..e843e60 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,22 @@ +FROM plurish/server:latest + +RUN apt-get install -y --no-install-recommends vim & \ + npm i -g yarn & \ + pecl install xdebug && docker-php-ext-enable xdebug + +WORKDIR /var/www + +COPY ./ ./ + +RUN chmod 777 /var/www /var/www/yarn.lock /var/www/public + +USER dev + +# Installing dependencies +RUN composer install & yarn +RUN composer clear-cache & yarn cache clean + +# Starting the app +COPY ./xdebug.ini "${PHP_INI_DIR}/conf.d" + +CMD ["bash", "./init.sh"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 042db8d..b85bc6f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,7 @@ services: image: plurish/ui:dev build: context: ./ - dockerfile: Dockerfile + dockerfile: Dockerfile.dev extra_hosts: - host.docker.internal:host-gateway restart: unless-stopped diff --git a/package.json b/package.json index ffccfd6..3ba036d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "devDependencies": { "@babel/core": "^7.17.0", "@babel/preset-env": "^7.16.0", - "@symfony/webpack-encore": "^4.0.0", "autoprefixer": "^10.4.16", "core-js": "^3.23.0", "postcss-loader": "^7.3.3", @@ -33,6 +32,7 @@ "vue": "^3.3.8", "vue-loader": "17.0.0", "vuetify": "^3.4.0", + "@symfony/webpack-encore": "^4.0.0", "webpack-plugin-vuetify": "^2.0.1" } } diff --git a/resources/app.html.twig b/resources/app.html.twig index d1f779b..fd9b6cd 100644 --- a/resources/app.html.twig +++ b/resources/app.html.twig @@ -13,6 +13,10 @@ + + {{ inertiaHead(page) }} {% block stylesheets %} diff --git a/resources/views/Auth/SignIn.vue b/resources/views/Auth/SignIn.vue index e660e51..01ae42b 100644 --- a/resources/views/Auth/SignIn.vue +++ b/resources/views/Auth/SignIn.vue @@ -120,6 +120,10 @@ export default defineComponent({ }, }), + mounted() { + window.scrollTo(0, 0); + }, + methods: { async signin(event: SubmitEventPromise) { const error = { diff --git a/resources/views/Auth/SignUp.vue b/resources/views/Auth/SignUp.vue index d11cac0..ca86d45 100644 --- a/resources/views/Auth/SignUp.vue +++ b/resources/views/Auth/SignUp.vue @@ -163,6 +163,10 @@ export default defineComponent({ }, }, + mounted() { + window.scrollTo(0, 0); + }, + methods: { async signup(event: SubmitEventPromise) { const error = {