Skip to content

Commit

Permalink
Merge pull request #13 from PatelUtkarsh/feature/auto-release
Browse files Browse the repository at this point in the history
Auto deploy zip on tag publish
  • Loading branch information
PatelUtkarsh authored Dec 5, 2023
2 parents 195afb8 + 3e14b6e commit c0c1880
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy
on:
release:
types: [published]
jobs:
tag:
name: New release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Build
run: |
composer install --no-dev --no-interaction --no-progress --optimize-autoloader --ignore-platform-reqs
- name: Create Release Asset
id: deploy
run: |
rsync -av --exclude-from='.distinogre' ./ ./tempfolder/
zip -r "${GITHUB_EVENT.repository.name}.zip" ./tempfolder/
echo "::set-output name=zip-path::${GITHUB_WORKSPACE}/${GITHUB_EVENT.repository.name}.zip"
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.deploy.outputs.zip-path }}
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip

0 comments on commit c0c1880

Please sign in to comment.