fixes #6
Workflow file for this run
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: Deploy to Linode | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Golang-Migrate | |
run: | | |
curl -L https://github.com/golang-migrate/migrate/releases/download/v4.18.1/migrate.linux-amd64.tar.gz | tar xvz | |
sudo mv migrate /usr/local/bin/migrate | |
- name: Install X11 development libraries | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libx11-dev | |
- uses: actions/setup-go@v5 | |
- name: Build app | |
run: go build -o sdump ./cmd | |
- name: SCP to Linode instance ( Binary ) | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.IP_ADDRESS }} | |
username: "root" | |
key: ${{ secrets.SSH_KEY }} | |
port: 22 | |
source: "sdump" | |
target: "/root" | |
- name: Run Migrations | |
run: | | |
migrate -database ${{ secrets.POSTGRES_ROOT_DSN }}/sdump -path ./datastore/sql/migrations up | |
- name: Restart sdump systemd service | |
uses: appleboy/ssh-action@master | |
env: | |
INFISICAL_CLIENT_ID: ${{ secrets.INFISICAL_CLIENT_ID }} | |
INFISICAL_CLIENT_SECRET: ${{ secrets.INFISICAL_CLIENT_SECRET }} | |
with: | |
host: ${{ secrets.IP_ADDRESS }} | |
username: "root" | |
key: ${{ secrets.SSH_KEY }} | |
port: 22 | |
script_path: deploy/linode.sh | |
envs: INFISICAL_CLIENT_ID,INFISICAL_CLIENT_SECRET |