Compare commits

...

1 Commits

Author SHA1 Message Date
dac9b0b5ed chore: update file config workflow
All checks were successful
CI Pipeline / Lint (push) Successful in 3m46s
CI Pipeline / Security Scan (push) Successful in 7m18s
CI Pipeline / Test (push) Successful in 3m47s
CI Pipeline / Build (push) Successful in 1m53s
CI Pipeline / Notification (push) Successful in 2s
2025-06-07 09:04:15 +07:00
2 changed files with 16 additions and 11 deletions

View File

@ -30,7 +30,12 @@ jobs:
with:
version: latest
args: --timeout=15m
enable: |
gofmt
goimports
staticcheck
unused
errcheck
- name: Notify on failure
if: failure()
run: echo "::warning::Linting failed. Please fix code style issues."
@ -40,16 +45,13 @@ jobs:
runs-on: ${{ secrets.RUNNER_LABEL || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache-dependency-path: go.sum
- name: Run Go Vulnerability Check
uses: golang/govulncheck-action@v1
- name: Notify on security issues
if: failure()
run: echo "::error::Security vulnerabilities detected. Please review dependencies."

View File

@ -73,7 +73,12 @@ jobs:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Cài Docker CLI
run: |
apt-get update
apt-get install -y docker.io
apt-get install -y curl
docker version
- name: Deploy to VPS
run: |
echo "Deploying image: ${{ env.IMAGE_NAME }}"
@ -92,14 +97,12 @@ jobs:
--restart always \
-p ${{ secrets.APP_PORT || '3000' }}:3000 \
-e APP_ENV=${{ secrets.APP_ENV || 'production' }} \
-e DB_HOST=${{ secrets.DB_HOST }} \
-e DB_USER=${{ secrets.DB_USER }} \
-e DB_PASSWORD=${{ secrets.DB_PASSWORD }} \
-e DB_NAME=${{ secrets.DB_NAME }} \
-e DB_HOST=${{ secrets.DATABASE_HOST }} \
-e DB_USER=${{ secrets.DATABASE_USER }} \
-e DB_PASSWORD=${{ secrets.DATABASE_PASSWORD }} \
-e DB_NAME=${{ secrets.DATABASE_NAME }} \
-e JWT_SECRET_KEY=${{ secrets.JWT_SECRET_KEY }} \
-e REFRESH_TOKEN_SECRET=${{ secrets.REFRESH_TOKEN_SECRET }} \
-e API_KEY=${{ secrets.API_KEY }} \
-e ENCRYPTION_KEY=${{ secrets.ENCRYPTION_KEY }} \
--health-cmd "${{ secrets.HEALTH_CMD || 'curl -f http://localhost:3000/health || exit 1' }}" \
--health-interval ${{ secrets.HEALTH_INTERVAL || '30s' }} \
--memory ${{ secrets.CONTAINER_MEMORY || '1g' }} \