Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ValeriiVasyliev/0e36a142ee808b22747d75f2842abaab to your computer and use it in GitHub Desktop.
Save ValeriiVasyliev/0e36a142ee808b22747d75f2842abaab to your computer and use it in GitHub Desktop.

Revisions

  1. Dorey Benjamin revised this gist Apr 26, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -52,7 +52,7 @@ jobs:

    # build sage based theme (remove if not used)
    - name: Update Composer Sage
    run: cd web/app/themes/sage && composer update --prefer-dist --no-progress --no-dev
    run: cd web/app/themes/${{ env.THEME }} && composer update --prefer-dist --no-progress --no-dev

    - name: Install and build JS dependencies
    run: cd web/app/themes/${{ env.THEME }} && yarn && yarn build:production
  2. Dorey Benjamin revised this gist Apr 26, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -60,7 +60,7 @@ jobs:

    # Environment config
    - name: Push files to the remote
    run: rsync --progress -avz --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --exclude=".git/" --exclude=".lando.yml" --exclude ".github/" --exclude "/web/app/themes/${{ env.THEME }}/node_modules/" --exclude "/web/app/themes/${{ env.THEME }}/assets/" --exclude=".gitignore" --exclude "/web/app/themes/${{ env.THEME }}/yarn.json" --exclude "/web/app/themes/${{ env.THEME }}/package.json" --exclude "/web/app/themes/${{ env.THEME }}/.npmrc"
    run: rsync --progress -avz --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --exclude=".git/" --exclude=".lando.yml" --exclude ".github/" --exclude "/web/app/themes/${{ env.THEME }}/node_modules/" --exclude "/web/app/themes/${{ env.THEME }}/resources/assets/" --exclude=".gitignore" --exclude "/web/app/themes/${{ env.THEME }}/package.json" --exclude "/web/app/themes/${{ env.THEME }}/.npmrc" --exclude "/web/app/themes/${{ env.THEME }}/yarn.lock"
    -e 'ssh -o StrictHostKeyChecking=no -p ${{ env.SSH_PORT }}' ./ ${{ env.SSH_USERNAME }}@${{ env.SSH_HOST }}:${{ env.KINSTA_FOLDER }}

    - name: Clear cache on kinsta
  3. Dorey Benjamin revised this gist Apr 25, 2022. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,7 @@ jobs:
    SSH_USERNAME: ${{ secrets.USERNAME }} #username
    KINSTA_FOLDER: ${{ secrets.REMOTE_DIR }} #/var/www/public
    DOMAIN: ${{ secrets.DOMAIN_STAGING }} #url.com
    THEME: 'themename'

    steps:
    - uses: actions/checkout@v2
    @@ -54,12 +55,12 @@ jobs:
    run: cd web/app/themes/sage && composer update --prefer-dist --no-progress --no-dev

    - name: Install and build JS dependencies
    run: cd web/app/themes/sage && yarn && yarn build:production
    run: cd web/app/themes/${{ env.THEME }} && yarn && yarn build:production


    # Environment config
    - name: Push files to the remote
    run: rsync --progress -avz --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --exclude=".git/" --exclude ".github/" --exclude "/web/app/themes/verkor/node_modules/"
    run: rsync --progress -avz --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --exclude=".git/" --exclude=".lando.yml" --exclude ".github/" --exclude "/web/app/themes/${{ env.THEME }}/node_modules/" --exclude "/web/app/themes/${{ env.THEME }}/assets/" --exclude=".gitignore" --exclude "/web/app/themes/${{ env.THEME }}/yarn.json" --exclude "/web/app/themes/${{ env.THEME }}/package.json" --exclude "/web/app/themes/${{ env.THEME }}/.npmrc"
    -e 'ssh -o StrictHostKeyChecking=no -p ${{ env.SSH_PORT }}' ./ ${{ env.SSH_USERNAME }}@${{ env.SSH_HOST }}:${{ env.KINSTA_FOLDER }}

    - name: Clear cache on kinsta
  4. Dorey Benjamin revised this gist Apr 14, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -59,7 +59,7 @@ jobs:

    # Environment config
    - name: Push files to the remote
    run: rsync --progress -avz --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r
    run: rsync --progress -avz --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --exclude=".git/" --exclude ".github/" --exclude "/web/app/themes/verkor/node_modules/"
    -e 'ssh -o StrictHostKeyChecking=no -p ${{ env.SSH_PORT }}' ./ ${{ env.SSH_USERNAME }}@${{ env.SSH_HOST }}:${{ env.KINSTA_FOLDER }}

    - name: Clear cache on kinsta
  5. Dorey Benjamin revised this gist Mar 3, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,7 @@ jobs:
    - name: Setup PHP
    uses: shivammathur/setup-php@v2
    with:
    php-version: '7.3'
    php-version: '7.4'

    - name: Install SSH key
    uses: shimataro/ssh-key-action@v2
  6. Dorey Benjamin created this gist Feb 7, 2022.
    67 changes: 67 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,67 @@
    #Go in your kinsta serv with ssh in terminal and make this two steps :
    #1: cat ~/.ssh/id_rsa.pub and copy paste in user setting in kinsta and SSH KEY
    #2: cat ~/.ssh/id_rsa and copy paste in secret SSH_KEY
    name: Deploy to Kinsta

    on:
    push:
    branches: [ main ]

    jobs:
    deploy:
    runs-on: ubuntu-latest
    env:
    ACF_PRO_KEY: ${{ secrets.ACF_PRO_KEY }} #exemple for premium plugins
    SSH_PORT: ${{ secrets.PORT }} #1547
    SSH_HOST: ${{ secrets.HOST }} #0.0.0.0
    SSH_KEY: ${{ secrets.SSH_KEY }}
    KNOWN_HOSTS: ${{ secrets.KNOWN_HOSTS }} #0.0.0.0:1547
    SSH_USERNAME: ${{ secrets.USERNAME }} #username
    KINSTA_FOLDER: ${{ secrets.REMOTE_DIR }} #/var/www/public
    DOMAIN: ${{ secrets.DOMAIN_STAGING }} #url.com

    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@v2
    with:
    node-version: '14'
    - name: Setup PHP
    uses: shivammathur/setup-php@v2
    with:
    php-version: '7.3'

    - name: Install SSH key
    uses: shimataro/ssh-key-action@v2
    with:
    key: ${{ env.SSH_KEY }}
    name: id_rsa # optional
    known_hosts: ${{ env.KNOWN_HOSTS }}
    if_key_exists: fail # replace / ignore / fail; optional (defaults to fail)

    - name: Cache Composer packages
    id: composer-cache
    uses: actions/cache@v2
    with:
    path: vendor
    key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
    restore-keys: |
    ${{ runner.os }}-php-
    - name: Update Composer Bedrock
    run: composer update --prefer-dist --no-progress --no-dev

    # build sage based theme (remove if not used)
    - name: Update Composer Sage
    run: cd web/app/themes/sage && composer update --prefer-dist --no-progress --no-dev

    - name: Install and build JS dependencies
    run: cd web/app/themes/sage && yarn && yarn build:production


    # Environment config
    - name: Push files to the remote
    run: rsync --progress -avz --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r
    -e 'ssh -o StrictHostKeyChecking=no -p ${{ env.SSH_PORT }}' ./ ${{ env.SSH_USERNAME }}@${{ env.SSH_HOST }}:${{ env.KINSTA_FOLDER }}

    - name: Clear cache on kinsta
    run: ssh ${{ env.SSH_USERNAME }}@${{ env.SSH_HOST }} -p ${{ env.SSH_PORT }} 'curl https://${{ env.DOMAIN }}/kinsta-clear-cache-all'