diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index 8c828e0..c052b92 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -20,7 +20,7 @@ jobs: steps: - name: 🚚 Get latest code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 📂 Deploy to Server uses: easingthemes/ssh-deploy@v4 @@ -32,4 +32,28 @@ jobs: REMOTE_USER: u106957989 REMOTE_PORT: '65002' TARGET: domains/codedthemes.com/public_html/demos/admin-templates/datta-able/bootstrap/free - EXCLUDE: '/node_modules/' + 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"