diff --git a/.github/.htaccess b/.github/.htaccess new file mode 100644 index 00000000..3de9e400 --- /dev/null +++ b/.github/.htaccess @@ -0,0 +1,10 @@ +# Apache 2.2 + + Order deny,allow + Deny from all + + +# Apache 2.4 + + Require all denied + diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..46742ef2 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,35 @@ +name: Deploy + +on: + pull_request: + types: [closed] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: build + # IF YOU EDIT THIS, DON'T FORGET TO EDIT release.yml + run: | + composer install --no-dev --optimize-autoloader --classmap-authoritative + composer dump-autoload --no-dev --optimize --classmap-authoritative + cp .github/.htaccess vendor/.htaccess + rm -rf .git + rm -rf .github + rm -rf tests + rm -rf cypress + rm -rf .docker + mkdir saferpayofficial + rsync -Rr ./ ./saferpayofficial + shopt -s extglob + rm -r !(saferpayofficial) + find . -maxdepth 1 -type f -exec rm "{}" \; + cd saferpayofficial && rm -rf saferpayofficial + - name: Archive production artifacts + uses: actions/upload-artifact@v2 + with: + name: saferpayofficial + path: | + . \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..749526e9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: release +on: + release: + types: [ published, edited, updated, drafted] +jobs: + build_release: + name: build_release + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: build + # IF YOU EDIT THIS, DON'T FORGET TO EDIT deploy.yml + run: | + composer install --no-dev --optimize-autoloader --classmap-authoritative + composer dump-autoload --no-dev --optimize --classmap-authoritative + cp .github/.htaccess vendor/.htaccess + rm -rf .git + rm -rf .github + rm -rf tests + rm -rf cypress + rm -rf .docker + mkdir saferpayofficial + rsync -Rr ./ ./saferpayofficial + shopt -s extglob + rm -r !(saferpayofficial) + find . -maxdepth 1 -type f -exec rm "{}" \; + cd saferpayofficial && rm -rf saferpayofficial + cd ../ && zip -r saferpayofficial.zip saferpayofficial/ + - name: Update release + id: update_release + uses: tubone24/update_release@v1.0 + env: + GITHUB_TOKEN: ${{ github.token }} + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.github_token }} + with: + upload_url: ${{ steps.update_release.outputs.upload_url }} + asset_path: ./saferpayofficial.zip + asset_name: saferpayofficial.zip + asset_content_type: application/zip