Fix EXCLUDE path formatting in prod.yml (#20) #27
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: Production deploy | |
| # Controls when the action will run. | |
| on: | |
| # Triggers the workflow on push or pull request events but only for the master branch | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| types: | |
| - closed | |
| branches: | |
| - master | |
| jobs: | |
| if_merged: | |
| if: github.event.pull_request.merged == true | |
| name: 🎉 Deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 🚚 Get latest code | |
| uses: actions/checkout@v4 | |
| - name: 📂 Deploy to Server | |
| uses: easingthemes/ssh-deploy@v4 | |
| env: | |
| SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }} | |
| ARGS: '-rltgoDzvO --delete' | |
| SOURCE: 'dist/' | |
| REMOTE_HOST: 82.29.156.38 | |
| REMOTE_USER: u106957989 | |
| REMOTE_PORT: '65002' | |
| TARGET: domains/codedthemes.com/public_html/demos/admin-templates/datta-able/bootstrap/free | |
| EXCLUDE: '/node_modules/' | |
| - name: Read version | |
| id: version | |
| run: echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV | |
| - name: 📦 Create version ZIP | |
| run: | | |
| zip -r "datta-able-bootstrap-v${VERSION}.zip" . \ | |
| -x ".git/*" \ | |
| -x ".github/workflows/*" \ | |
| -x ".gitignore" \ | |
| -x "node_modules/*" | |
| - name: 🔑 Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: us-west-2 | |
| - name: 🚀 Upload ZIP to S3 | |
| run: | | |
| aws s3 cp "datta-able-bootstrap-v${VERSION}.zip" \ | |
| "s3://${{ secrets.AWS_S3_BUCKET }}/DattaAble/Bootstrap/datta-able-bootstrap-v${VERSION}.zip" |