diff --git a/.github/workflows/gogs.yml b/.github/workflows/gogs.yml new file mode 100644 index 0000000000..7765f5003d --- /dev/null +++ b/.github/workflows/gogs.yml @@ -0,0 +1,34 @@ +name: gogs +on: workflow_dispatch +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true +permissions: {} +jobs: + build: + # https://github.com/actions/virtual-environments + runs-on: ubuntu-22.04 + steps: + # https://github.com/actions/setup-go/tags + - uses: actions/setup-go@v3 + with: + go-version: 'stable' + - name: Build + run: | + apt-get update + apt-get -qq full-upgrade + apt-get -qq install zip 7zip + go install 'gogs.io/gogs@latest' + mkdir gogs + mv go/bin/gogs gogs/ + zip -9r gogs_armv6.zip gogs + 7zz a -mx=9 gogs_armv6l.7z gogs + - name: Upload + run: | + mkdir -pv .ssh + umask 377 + echo '${{ secrets.KNOWN_HOSTS }}' > .ssh/known_hosts + echo '${{ secrets.SSH_KEY }}' > .ssh/id_ed25519 + curl -T 'gogs_armv6*' --key .ssh/id_ed25519 'sftp://github@ssh.dietpi.com:29248/all/' + curl 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache' -H 'Authorization: Bearer ${{ secrets.CF_TOKEN }}' -H 'Content-Type: application/json' \ + --data '{"files":["https://dietpi.com/downloads/binaries/all/","https://dietpi.com/downloads/binaries/all/gogs_armv6.zip","https://dietpi.com/downloads/binaries/all/gogs_armv6l.7z"]}'