Skip to content

finalize: cleanup

finalize: cleanup #11

Workflow file for this run

name: Sally CD Pipeline
on:
push:
branches:
- master
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Check Out Code
uses: actions/checkout@v2
- name: Set Up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.3'
- name: Get Commit Hash
id: get_commit_hash
run: echo ::set-output name=COMMIT_HASH::${{ github.sha }}
- name: Build Artifact
run: GOARCH=amd64 go build -v --tags v-${{ steps.get_commit_hash.outputs.COMMIT_HASH }} -o sally
- name: Deploy Artifact to Server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
source: "sally"
target: "~/app"
- name: Restart Application
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: sudo systemctl restart go-app.service