-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (31 loc) · 951 Bytes
/
ci.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
name: Wazuh Decoder & Rule CI Pipeline
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
run-wazuh-tests:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v2
- name: Extract branch name
id: extract_branch
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Pull Docker image
run: docker pull ${{ secrets.DOCKER_IMAGE }}
- name: Run container with branch info
run: |
docker run -e BRANCH_NAME=${{ steps.extract_branch.outputs.branch }} ${{ secrets.DOCKER_IMAGE }} || exit 1
- name: Verify container exit status
run: |
echo "Container ran successfully."