chore: update Docker Compose setup and environment variables #3
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: 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 ./... | |
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: Set up Docker Compose | |
- name: Set up Docker Compose | |
run: | | |
docker compose build | |
docker compose push | |
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 |