Skip to content

ci cd fix

ci cd fix #4

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "main" ]
jobs:
build:
services:
database:
image: timescale/timescaledb:latest-pg14
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: semonitor
options: >-
--health-cmd "pg_isready -d tsdb -U username"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Build
run: go build -v ./...
- name: Create .env file
run: |
touch .env
echo DATABASE_URL=postgres://user:password@localhost:5432/semonitor >> .env
cat .env
- name: Test
run: go test -v ./...
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: deploy
name: Deploy to dokku
uses: idoberko2/dokku-deploy-github-action@v1
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
dokku-host: 'idoberko2.com'
app-name: 'semonitor'
commit: 'main'
remote-branch: 'master'