diff --git a/.github/workflows/ci.yml b/.github/workflows/ci-dockerhub.yml similarity index 97% rename from .github/workflows/ci.yml rename to .github/workflows/ci-dockerhub.yml index c71c3ae..bc007dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci-dockerhub.yml @@ -1,4 +1,4 @@ -name: ci +name: ci-dockerhub on: push: diff --git a/.github/workflows/ci-static.yml b/.github/workflows/ci-static.yml new file mode 100644 index 0000000..ad802eb --- /dev/null +++ b/.github/workflows/ci-static.yml @@ -0,0 +1,64 @@ +name: ci-static + +on: + push: + tags: + - v* + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + extensions: zip + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 14 + + - name: Setup Git and SSH access + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + run: | + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + ssh-agent -a $SSH_AUTH_SOCK > /dev/null + ssh-add - <<< "${{ secrets.STATIC_SSH_PRIVATE_KEY }}" + + - name: Build and upload to static + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + run: | + cp configuration_sample.php configuration.php + chmod -R u+w repository/ + chmod -R u+w private/ + composer install --no-dev + npm install + npm run build + rm -Rf node_modules + rm -Rf frontend + rm -Rf tests + rm -Rf docs + rm -Rf .git + rm -Rf .github + rm README.md couscous.yml repository/.gitignore babel.config.js cypress* .env* .eslint* .gitignore jest.* .php_cs* phpunit* postcss* vue* + cd .. + zip -r filegator_${{ github.ref_name }}.zip ${{ github.event.repository.name }} + git clone git@github.com:filegator/static.git + cp filegator_${{ github.ref_name }}.zip static/builds/filegator_${{ github.ref_name }}.zip + rm static/builds/filegator_latest.zip + cp filegator_${{ github.ref_name }}.zip static/builds/filegator_latest.zip + cd static + git add . + git commit -m "releasing static files for ${{ github.ref_name }}" + git push +