Skip to content

Commit

Permalink
Github actions for deploy addition
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjas1997 committed Oct 17, 2022
1 parent 22bfdce commit e910938
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Apache 2.2
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>

# Apache 2.4
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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: |
.
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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

0 comments on commit e910938

Please sign in to comment.