Skip to content

Commit

Permalink
feat: savannah api service
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-kores committed Feb 23, 2024
1 parent 8283e46 commit 671973a
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflow/ci-cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Go CI/CD to Azure

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.21' # Specify your desired Go version here

- name: Install PostgreSQL client
run: sudo apt-get install postgresql-client

- name: Build
run: go build -v . ./cmd/api/

deploy:
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Azure CLI
uses: azure/CLI@v1
with:
azcliversion: latest
azlogin: true

- name: Log in to Azure
run: az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}

- name: Set PostgreSQL connection string
run: echo "export DATABASE_URL='POSTGRES_CONNECTION_STRING'" >> $GITHUB_ENV


- name: Deploy to Azure
run: az webapp up -n YOUR_APP_NAME -g RESOURCE_GROUP_NAME

0 comments on commit 671973a

Please sign in to comment.