Update #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master, main] | |
repository_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: "Cancel other workflows" | |
uses: potiuk/cancel-workflow-runs@master | |
with: | |
cancelMode: allDuplicates | |
cancelFutureDuplicates: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
workflowFileName: main.yml | |
- name: Set env | |
run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV | |
- name: Create ZIP archive | |
run: | | |
mkdir ${{ env.REPOSITORY_NAME }} | |
rsync -av --exclude='./${{ env.REPOSITORY_NAME }}' ./ ./${{ env.REPOSITORY_NAME }} | |
find ./${{ env.REPOSITORY_NAME }} -path '*/.*' -prune -o -type f -print | zip ./build.zip -@ | |
rm -rf ${{ env.REPOSITORY_NAME }} | |
- name: Deploy ZIP archive to bitter.de | |
run: | | |
curl -i -X POST -H "Content-Type: multipart/form-data" -F \ | |
'[email protected]' \ | |
https://www.bitter.de/api/v1/addons/update/${{ env.REPOSITORY_NAME }} | |
- name: Trigger Build Workflow for bitter_de | |
run: | | |
curl -XPOST -u "bitterdev:${{secrets.PRIVATE_ACCESS_TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/bitterdev/bitter_de/dispatches --data '{"event_type": "build_application"}' |