57 lines
2.2 KiB
YAML
57 lines
2.2 KiB
YAML
name: Build Electron
|
|
run-name: Build Electron
|
|
|
|
on:
|
|
push:
|
|
|
|
jobs:
|
|
docker:
|
|
name: Build Dockerfile
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: docker
|
|
volumes:
|
|
- /tmp/gitea:/tmp/gitea
|
|
steps:
|
|
- name: Clone Repository
|
|
uses: ztimson/actions/clone@develop
|
|
|
|
- name: Build Image
|
|
run: |
|
|
REGISTRY=$(echo ${{github.server_url}} | sed s%http://%% | sed s%https://%%)
|
|
docker build -t "$REGISTRY/${{github.repository}}:${{github.ref_name}}" .
|
|
|
|
- name: Publish Branch Tag
|
|
run: |
|
|
REGISTRY=$(echo ${{github.server_url}} | sed s%http://%% | sed s%https://%%)
|
|
docker login -u ${{github.repository_owner}} -p ${{secrets.DEPLOY_TOKEN}} $REGISTRY
|
|
docker push "$REGISTRY/${{github.repository}}:${{github.ref_name}}"
|
|
|
|
- name: Publish Latest Tag
|
|
run: |
|
|
if [ "${{github.ref_name}}" = "master" ]; then
|
|
REGISTRY=$(echo ${{github.server_url}} | sed s%http://%% | sed s%https://%%)
|
|
docker tag "$REGISTRY/${{github.repository}}:${{github.ref_name}}" "$REGISTRY/${{github.repository}}:latest"
|
|
docker push "$REGISTRY/${{github.repository}}:latest"
|
|
fi
|
|
|
|
electron:
|
|
name: Build Electron
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- docker
|
|
container:
|
|
image: git.zakscode.com/momentum/electron:latest
|
|
steps:
|
|
- name: Build inside container
|
|
run: |
|
|
if [ "${{github.ref_name}}" = "master" ]; then
|
|
/app/entrypoint.sh
|
|
curl -X PUT -H "Authorization: token ${{ secrets.DEPLOY_TOKEN }}" --upload-file /out/Momentum-darwin-x64.zip \
|
|
https://git.zakscode.com/api/packages/momentum/generic/electron/latest/Momentum-darwin-x64.zip
|
|
curl -X PUT -H "Authorization: token ${{ secrets.DEPLOY_TOKEN }}" --upload-file /out/Momentum-linux-x64.zip \
|
|
https://git.zakscode.com/api/packages/momentum/generic/electron/latest/Momentum-linux-x64.zip
|
|
curl -X PUT -H "Authorization: token ${{ secrets.DEPLOY_TOKEN }}" --upload-file /out/Momentum-win32-x64.zip \
|
|
https://git.zakscode.com/api/packages/momentum/generic/electron/latest/Momentum-win32-x64.zip
|
|
fi
|