Compare commits
10 Commits
6712baf977
...
99572cfe38
Author | SHA1 | Date | |
---|---|---|---|
99572cfe38 | |||
b7967013ec | |||
958fd42cae | |||
7a8bdd8ad7 | |||
f5603ae4db | |||
9894f888d5 | |||
![]() |
ed8ba99a71 | ||
![]() |
fb93d80f9d | ||
ea8e618ff6 | |||
9614c05b3c |
37
.github/workflows/push-to-gitea.yml
vendored
37
.github/workflows/push-to-gitea.yml
vendored
@ -1,31 +1,26 @@
|
|||||||
name: "Gitea Mirror Setup"
|
name: Sync to Gitea
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
- cron: 0 0 * * *
|
|
||||||
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
sync:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: varunsridharan/action-gitea-mirror@main
|
- name: Checkout source repo
|
||||||
name: " ⏳ Setting Up Mirror"
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
gh_username: ${{ secrets.GH_USERNAME }}
|
fetch-depth: 0
|
||||||
gh_accesstoken: ${{ secrets.GH_TOKEN }}
|
|
||||||
gitea_host: ${{ secrets.GITEA_HOST }}
|
- name: Push to Gitea
|
||||||
gitea_username: ${{ secrets.GITEA_USERNAME }}
|
run: |
|
||||||
gitea_accesstoken: ${{ secrets.GITEA_TOKEN }}
|
git config --global user.name "Push From Github"
|
||||||
gitea_gist_prefix: "gist"
|
git config --global user.email "actions@github.com"
|
||||||
gitea_gist_surfix: ""
|
git remote add gitea http://$GITEA_USER:$GITEA_TOKEN@git.community-scripts.org/community-scripts/ProxmoxVED.git
|
||||||
gistsSource: true
|
git push gitea --mirror
|
||||||
gistsStared: true
|
env:
|
||||||
repositoryStared: true
|
GITEA_USER: ${{ secrets.GITEA_USERNAME }}
|
||||||
repositorySource: true
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
repositoryForked: true
|
|
||||||
|
@ -24,20 +24,24 @@ msg_ok "Installed dependencies"
|
|||||||
|
|
||||||
msg_info "Installing PostgreSQL"
|
msg_info "Installing PostgreSQL"
|
||||||
$STD apk add --no-cache \
|
$STD apk add --no-cache \
|
||||||
postgresql15 \
|
postgresql16 \
|
||||||
postgresql15-contrib \
|
postgresql16-contrib \
|
||||||
postgresql15-openrc
|
postgresql16-openrc
|
||||||
|
$STD rc-update add postgresql
|
||||||
|
$STD rc-service postgresql start
|
||||||
msg_ok "Installed PostreSQL"
|
msg_ok "Installed PostreSQL"
|
||||||
|
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/bitmagnet-io/bitmagnet/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
RELEASE=$(curl -s https://api.github.com/repos/bitmagnet-io/bitmagnet/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
|
|
||||||
msg_info "Installing bitmagnet v${RELEASE}"
|
msg_info "Installing bitmagnet v${RELEASE}"
|
||||||
mkdir /opt/bitmagnet
|
mkdir -p /opt/bitmagnet
|
||||||
temp_file=$(mktemp)
|
temp_file=$(mktemp)
|
||||||
curl -fsSL "https://github.com/bitmagnet-io/bitmagnet/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
|
curl -fsSL "https://github.com/bitmagnet-io/bitmagnet/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
|
||||||
tar zxf "$temp_file" --strip-components=1 -C /opt/bitmagnet
|
tar zxf "$temp_file" --strip-components=1 -C /opt/bitmagnet
|
||||||
cd /opt/bitmagnet
|
cd /opt/bitmagnet
|
||||||
$STD go build -ldflags "-s -w -X github.com/bitmagnet-io/bitmagnet/internal/version.GitTag=$(git describe --tags --always --dirty)"
|
$STD go build
|
||||||
|
chmod +x bitmagnet
|
||||||
|
$STD su - postgres -c "psql -c 'CREATE DATABASE bitmagnet;'"
|
||||||
echo "${RELEASE}" >/opt/bitmagnet_version.txt
|
echo "${RELEASE}" >/opt/bitmagnet_version.txt
|
||||||
msg_ok "Installed bitmagnet v${RELEASE}"
|
msg_ok "Installed bitmagnet v${RELEASE}"
|
||||||
|
|
||||||
@ -68,5 +72,6 @@ motd_ssh
|
|||||||
customize
|
customize
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Cleaning up"
|
||||||
|
rm -f $temp_file
|
||||||
$STD apk cache clean
|
$STD apk cache clean
|
||||||
msg_ok "Cleaned"
|
msg_ok "Cleaned"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user