Skip to content

Commit

Permalink
Update push_test_server.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
raller1028 authored Feb 17, 2023
1 parent 2ddcc99 commit 5c3f414
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions .github/workflows/push_test_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,20 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: isntall git
run: sudo apt install --yes git

- name: git global
run: sudo git config --global --add safe.directory '*'
-
name: Fetch all tags

- name: set version
run: sudo git tag v99.99.99-alpha

- name: Fetch all tags
run: sudo git fetch --force --tags
- name: Get version
id: get_version
# run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
run: echo "VERSION=$(git describe --abbrev=0 --tags | awk -F- '{print $1}')" >> $GITHUB_ENV
- name: show version
id: show_version
# run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
run: echo ${{env.VERSION}}
-
name: Set up Go

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
Expand All @@ -41,18 +38,30 @@ jobs:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --rm-dist
args: release --rm-dist --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

- name: remove migration file
run: find . -type f \( -name '*migration*' \) -delete

- name: install sshpass
run: sudo apt install sshpass --yes

- name: ZeroTier
uses: zerotier/[email protected]
with:
network_id: ${{ secrets.ZEROTIER_NETWORK_ID }}
auth_token: ${{ secrets.ZEROTIER_CENTRAL_TOKEN }}

- name: copy tar to target host
shell: bash
run: |
sshpass -p "${{ secrets.ssh_password }}" scp -r -o StrictHostKeyChecking=no -P ${{ secrets.ssh_port }} ./dist/*.gz root@${{ secrets.ssh_ip }}:/var/www/download
sshpass -p "${{ secrets.ssh_password }}" scp -r -o StrictHostKeyChecking=no -P 22 ./dist/*.gz root@10.147.18.11:/var/www/download
echo "ping success"
- name: send message
run: |
curl -X POST -H "Content-Type: application/json" -d '{"msg_type":"text","content":{"text":"CasaOS-MessageBus updated"}}' https://open.feishu.cn/open-apis/bot/v2/hook/eb8f45c7-9636-4b64-84f2-a66d9aeb9d30
curl -X POST -H "Content-Type: application/json" -d '{"msg_type":"text","content":{"text":"CasaOS-MessageBus updated"}}' ${{ secrets.SSH_ROBOT_URL }}

0 comments on commit 5c3f414

Please sign in to comment.