Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update push_test_server.yml #39

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 10 additions & 73 deletions .github/workflows/push_test_server.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,15 @@
name: Auto Publish Website
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-22.04
steps:
-
name: Checkout
uses: actions/checkout@v3
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: set version
run: sudo git tag v99.99.99-alpha

- name: Fetch all tags
run: sudo git fetch --force --tags

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
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/github-action@v1.0.1
with:
network_id: ${{ secrets.ZEROTIER_NETWORK_ID }}
auth_token: ${{ secrets.ZEROTIER_CENTRAL_TOKEN }}

- name: ping host
shell: bash
run: |
count=10
while ! ping -c 1 10.147.18.11 ; do
echo "waiting..." ;
sleep 1 ;
let count=count-1
done
echo "ping success"

- name: copy tar to target host
shell: bash
run: |
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"}}' ${{ secrets.SSH_ROBOT_URL }}
call-workflow-passing-data:
uses: IceWhaleTech/github/.github/workflows/push_test_server.yml@main
with:
project-name: casaos-messagebus
secrets:
ZEROTIER_NETWORK_ID: ${{ secrets.ZEROTIER_NETWORK_ID }}
ZEROTIER_CENTRAL_TOKEN: ${{ secrets.ZEROTIER_CENTRAL_TOKEN }}
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
SSH_ROBOT_URL: ${{ secrets.SSH_ROBOT_URL }}
Loading