diff --git a/.env.example b/.env.example index 52760b7..53c6bc1 100644 --- a/.env.example +++ b/.env.example @@ -1,20 +1,22 @@ +# API Configuration PORT=9000 GIN_MODE=release -JWT_SECRET_KEY=B7EobRo3PJwGIwZqJFMgqg7Av2CBD1yw -JWT_SECRET_REFRESH_KEY=khLCOW5YqXFb5rZrNZUx1g5Cz2iWuFP5 +# JWT Configuration +JWT_SECRET_KEY=your_jwt_secret_key +JWT_SECRET_REFRESH_KEY=your_jwt_secret_refresh_key +# Logging Configuration LOG_LEVEL=info LOG_OUTPUT=stdout -AUTHORIZATION_URL="https://util.devi.tools/api/v2/authorize" +# Order Authorization URL +AUTHORIZATION_URL="https://util.devi.tools/api/v2/authorize" +# Database Configuration POSTGRES_HOST=db POSTGRES_PORT=5432 -POSTGRES_USER=postgres -POSTGRES_PASSWORD=PassDBdj88674 -POSTGRES_DB=postgres -POSTGRES_URL="postgres://postgres:PassDBdj88674@db:5432/postgres?sslmode=disable" - - - +POSTGRES_USER=your_postgres_user +POSTGRES_PASSWORD=your_postgres_password +POSTGRES_DB=your_postgres_db +POSTGRES_URL="postgres://your_postgres_user:your_postgres_password@db:5432/your_postgres_db?sslmode=disable" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bd9fafe..f66b77b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,41 +10,50 @@ jobs: build: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version-file: go.mod + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version-file: go.mod - - name: Build - run: go build -v ./... - - - name: Test - run: go test -v ./internal/... + - name: Build + run: go build -v ./... + - name: Test + run: go test -v ./internal/... + check: needs: build runs-on: ubuntu-22.04 + env: + PORT: ${{ secrets.PORT }} + GIN_MODE: ${{ secrets.GIN_MODE }} + LOG_LEVEL: ${{ secrets.LOG_LEVEL }} + LOG_OUTPUT: ${{ secrets.LOG_OUTPUT }} + AUTHORIZATION_URL: ${{ secrets.AUTHORIZATION_URL }} + POSTGRES_HOST: ${{ secrets.POSTGRES_HOST }} + POSTGRES_PORT: ${{ secrets.POSTGRES_PORT }} + POSTGRES_USER: ${{ secrets.POSTGRES_USER }} + POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} + POSTGRES_DB: ${{ secrets.POSTGRES_DB }} + POSTGRES_URL: ${{ secrets.POSTGRES_URL }} steps: - - uses: actions/checkout@v3 - - - name: Copy .env.example to .env - run: cp .env.example .env + - uses: actions/checkout@v3 - - name: Run project - run: make ci + - name: Run project + run: make ci - - name: Set up Go for E2E tests - uses: actions/setup-go@v3 - with: - go-version-file: go.mod + - name: Set up Go for E2E tests + uses: actions/setup-go@v3 + with: + go-version-file: go.mod - - name: Run E2E tests - run: go test -v ./e2e/... + - name: Run E2E tests + run: go test -v ./e2e/... - - if: failure() - run: docker-compose ps + - if: failure() + run: docker-compose ps - - if: failure() - run: docker-compose logs + - if: failure() + run: docker-compose logs