Add geodb. #133
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build application | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| jobs: | |
| web-deploy: | |
| name: 🎉 Deploy to Mody Cloud | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 🚚 Get latest code | |
| uses: actions/checkout@v3 | |
| - name: ACF Auth | |
| run: | | |
| cp sample-auth.json auth.json | |
| sed -i 's|"ENTER YOUR LICENSE KEY"|"${{ secrets.ACF_AUTH }}"|g' auth.json | |
| sed -i 's|"ENTER YOUR WEBSITE URL"|"${{ vars.SITE_URL }}"|g' auth.json | |
| cat auth.json | |
| - name: Cache Vendor | |
| id: cache-vendor | |
| uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-vendors | |
| with: | |
| path: vendor | |
| key: vendor-${{ runner.os }}-${{ hashFiles('composer.lock') }} | |
| restore-keys: | | |
| vendor-${{ runner.os }}- | |
| - name: Cache Plugins | |
| id: cache-plugins | |
| uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-plugins | |
| with: | |
| path: web/content/plugins/ | |
| key: plugins-${{ runner.os }}-${{ hashFiles('web/content/plugins/**') }} | |
| restore-keys: | | |
| plugins-${{ runner.os }}- | |
| - name: Cache Node Modules | |
| id: cache-node_modules | |
| uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-node_modules | |
| with: | |
| path: node_modules | |
| key: node_modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: | | |
| node_modules-${{ runner.os }}- | |
| - name: Composer Install | |
| run: composer install --no-dev -o | |
| if: steps.cache-vendor.outputs.cache-hit != 'true' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: nvm use ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: pnpm install | |
| run: pnpm install | |
| if: steps.cache-node_modules.outputs.cache-hit != 'true' | |
| - name: pnpm build | |
| run: pnpm build | |
| - name: Set up SSH | |
| uses: webfactory/ssh-agent@v0.5.3 | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - name: 📂 Sync files to VPS using SSH | |
| run: | | |
| rsync -e "ssh -o StrictHostKeyChecking=no" -avz --no-times --update --exclude='node_modules' --exclude='package.json' --exclude='.git*' --exclude='src/scripts' --exclude='src/scss' --exclude='pint.json' --exclude='composer.lock' --exclude='sample*' --exclude='*.md' --exclude='create-migration*' --exclude='extract-twig*' --exclude='pnpm*' --exclude='wp-cli*' ./* ${{ vars.SSH_USER_SERVER }}:${{ vars.TARGET_DIR }} --verbose | |
| env: | |
| SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - name: 🛠 Change ownership on VPS | |
| run: | | |
| ssh -o StrictHostKeyChecking=no ${{ vars.SSH_USER_SERVER }} "sudo /home/deploy/chown" | |