diff --git a/.github/workflows/hml.yml b/.github/workflows/hml.yml new file mode 100644 index 0000000..a426ed2 --- /dev/null +++ b/.github/workflows/hml.yml @@ -0,0 +1,34 @@ +name: Deploy HML +on: + push: + branches: [ hml ] +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Sync + env: + dest: '${{vars.USER}}@${{vars.HOST}}:${{vars.THEMEPATHDEV}}' + run: | + echo "${{secrets.DEPLOY_KEY}}" > deploy_key + chmod 600 ./deploy_key + rsync -chav --delete \ + -e 'ssh -i ./deploy_key -o StrictHostKeyChecking=no' \ + --exclude /deploy_key \ + --exclude /.git/ \ + --exclude /.github/ \ + --exclude /node_modules/ \ + ./ ${{env.dest}} + + - name: SSH Remote Commands + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{vars.HOST}} + username: ${{vars.USER}} + key: ${{secrets.DEPLOY_KEY}} + script: | + cd ${{vars.THEMEPATHDEV}} + git checkout hml + wp theme activate site-america-aberta --allow-root + wp nginx-helper purge-all --allow-root \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..2f7c8fc --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +name: Deploy Main +on: + push: + branches: [ main ] +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Sync + env: + dest: '${{vars.USER}}@${{vars.HOST}}:${{vars.THEMEPATHPROD}}' + run: | + echo "${{secrets.DEPLOY_KEY}}" > deploy_key + chmod 600 ./deploy_key + rsync -chav --delete \ + -e 'ssh -i ./deploy_key -o StrictHostKeyChecking=no' \ + --exclude /deploy_key \ + --exclude /.git/ \ + --exclude /.github/ \ + --exclude /node_modules/ \ + ./ ${{env.dest}} + + - name: SSH Remote Commands + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{vars.HOST}} + username: ${{vars.USER}} + key: ${{secrets.DEPLOY_KEY}} + script: | + cd ${{vars.THEMEPATHPROD}} + git checkout main + wp theme activate site-america-aberta --allow-root + wp nginx-helper purge-all --allow-root \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 5469669..0000000 --- a/.gitignore +++ /dev/null @@ -1,48 +0,0 @@ -# Wordpress - ignore core, configuration, examples, uploads and logs. -# https://github.com/github/gitignore/blob/main/WordPress.gitignore - -# Core -# -# Note: if you want to stage/commit WP core files -# you can delete this whole section/until Configuration. -/wp-admin/ -/wp-content/index.php -/wp-content/languages -/wp-content/plugins/index.php -/wp-content/themes/index.php -/wp-includes/ -/index.php -/license.txt -/readme.html -/wp-*.php -/xmlrpc.php - -# Configuration -wp-config.php - -# Example themes -/wp-content/themes/twenty*/ - -# Example plugin -/wp-content/plugins/hello.php - -# Uploads -/wp-content/uploads/ - -# Log files -*.log - -# htaccess -/.htaccess - -# All plugins -# -# Note: If you wish to whitelist plugins, -# uncomment the next line -#/wp-content/plugins - -# All themes -# -# Note: If you wish to whitelist themes, -# uncomment the next line -#/wp-content/themes \ No newline at end of file diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..951b07b --- /dev/null +++ b/functions.php @@ -0,0 +1,27 @@ + section and everything up until