Skip to content

Update go-ci-cd.yml

Update go-ci-cd.yml #2

Workflow file for this run

name: Golang CI/CD
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.4
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21.4
- name: Deploy to Production
run: |
# Add deployment steps (e.g., deploying to a server, Docker registry, etc.)
# Example: deploy.sh
# deploy.sh content:
# #!/bin/bash
# echo "Deploying to production..."
# # Add your deployment logic here
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}