diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e177f6..328c62f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,30 @@ jobs: env: UPLOAD_KEY: ${{ secrets.UPLOAD_KEY }} steps: - - name: Settalo - run: echo $UPLOAD_KEY > test.txt - - name: Gettalo - run: cat test.txt | sed 's/./& /g' + - uses: actions/checkout@v4 + - run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV + - run: wget -q https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz + - run: sudo tar -xf go1.13.4.linux-amd64.tar.gz + - run: sudo mv go /usr/local + - run: echo "GOPATH=$HOME/go" >> $GITHUB_ENV + - run: echo "GOROOT=/usr/local/go" >> $GITHUB_ENV + - run: echo "PATH=$GOPATH/bin:$GOROOT/bin:$PATH" >> $GITHUB_ENV + - run: mkdir -p $HOME/go/src + - run: mkdir -p $HOME/go/bin + - run: go get "github.com/gobuffalo/packr/v2/packr2" + id: prepare_backend + - uses: actions/setup-node@v4 + with: + node-version: '16.x' + - run: cd webmanager && npm install && npm run-script build-prod && cd .. + id: build_frontend + - run: make + id: build_backend + if: ${{ success() }} + - name: Upload artifacts + id: upload + env: + UPLOAD_KEY: ${{ secrets.UPLOAD_KEY }} + UPLOAD_URL: ${{ vars.UPLOAD_URL }} + if: ${{ success() }} + run: cd dist && find * -type f -exec ./scripts/upload-builds.sh diff --git a/scripts/upload-builds.sh b/scripts/upload-builds.sh new file mode 100755 index 0000000..6cec910 --- /dev/null +++ b/scripts/upload-builds.sh @@ -0,0 +1 @@ +echo 'Uploading @{}' \; -exec curl -4 -F 'file=@{}' -F "path=$branch/{}" -F "key=$UPLOAD_KEY" "$UPLOAD_URL" \;;