-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.47 KB
/
go.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: GoCommerce Build and Push Docker Compose Services
on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: Install Dependencies
run: go mod tidy
- name: Run Linter
run: |
go install golang.org/x/lint/golint@latest
golint ./...
- name: Run Tests
run: go test -v ./...
env:
MONGODB_URI: ${{ secrets.MONGODB_URI }}
build-and-push:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository
- uses: actions/checkout@v4
# Step 2: Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Step 3: Build and push Docker image
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/gocommerce:latest
env:
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }}
RABBITMQ_URI: ${{ secrets.RABBITMQ_URI }}
MONGODB_URI: ${{ secrets.MONGODB_URI }}
MONGODB_NAME: GoCommerce
ORDER_QUEUE_NAME: orderNotifications
DEFAULT_TIMEOUT: 30s
PORT: 8000