Merge pull request #7 from veekaybee/non_standard_link #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push to prod | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: # manual | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.21.x' | |
cache-dependency-path: | | |
go.sum | |
- name: Fmt | |
run: make fmt | |
- name: Build | |
run: make build | |
- name: Test | |
run: make test | |
- name: Sync executables | |
run: | | |
rsync -avz "ingest" "serve" ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }}:${{ secrets.REMOTE_PATH }} | |
- name: Restart executables | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.REMOTE_HOST }} | |
username: ${{ secrets.REMOTE_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script_path: .github/workflows/restart.sh |