forked from splunk/docker-splunk
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.52 KB
/
base_image.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
40
41
42
43
44
45
46
47
48
49
name: base_image
on:
push:
branches:
- develop
paths:
- base/redhat-8/**
jobs:
build_base_image:
name: Build Base Image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
with:
submodules: true
- name: Set environment variables
run: |
echo $(grep "SPLUNK_VERSION " Makefile | cut -d " " -f3) > tag_splunk_version
echo $(grep "SCLOUD_URL " Makefile | cut -d " " -f3) > tag_scloud_url
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build base image
run: |
docker build \
--build-arg SCLOUD_URL=$(cat tag_scloud_url) \
--label version=$(cat tag_splunk_version) \
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/redhat-8:latest \
./base/redhat-8
- name: Push base image to Docker Hub
run: docker push --all-tags ${{ secrets.DOCKER_HUB_USERNAME }}/redhat-8
- name: Trigger splunk_image workflow
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
https://api.github.com/repos/${{ github.repository_owner }}/${{ github.repository }}/actions/workflows/splunk_image.yml/dispatches \
-d '{"ref":"develop"}'