Skip to content

test trigger workflows #7

test trigger workflows

test trigger workflows #7

Workflow file for this run

name: CI Session
on:
push:
branches:
- main
paths:
- 'cmd/session/**'
- 'internal/common/**'
- 'internal/models/**'
- 'internal/services/session/**'
- 'session.dockerfile'
- '!docker-compose.yml'
- '!assets/**'
- '!config/**'
- '!web/**'
- '!grafana/**'
- '!prometheus/**'
- '!README.md'
jobs:
build-images:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
file: session.dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/rvc-session:${{ github.sha }}
image-scan:
runs-on: ubuntu-latest
needs: build-images
steps:
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.20.0
with:
image-ref: 'docker.io/${{ secrets.DOCKER_USERNAME }}/rvc-session:${{ github.sha }}'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'
update-docker-compose:
runs-on: ubuntu-latest
needs: build-images
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Update Docker Compose
run: |
sed -i 's|docker.io/notmde/rvc-session.*|docker.io/notmde/rvc-session:${{ github.sha }}|g' docker-compose.yml
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add docker-compose.yml
git commit -m "update docker-compose.yml with ${{ github.sha }} image tag"
git push origin HEAD:refs/heads/update-docker-compose-for-session-service
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
title: update docker-compose.yml for rvc-session image
commit-message: update docker-compose.yml for rvc-session image
branch: update-docker-compose-for-session-service