-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (50 loc) · 1.61 KB
/
build.yml
File metadata and controls
50 lines (50 loc) · 1.61 KB
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
50
name: Docker CI
on:
workflow_dispatch:
push:
branches: [ main ]
paths-ignore:
- '.gitignore'
- '**.md'
schedule:
- cron: '15 2 * * *'
env:
CURRENT_CHANNEL: 24.04
PREVIOUS_CHANNEL: 22.04
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build 22.04
run: |
docker build . --pull --build-arg OS_VERSION=${{env.PREVIOUS_CHANNEL}} --tag bshp/ocie:${{env.PREVIOUS_CHANNEL}} --no-cache
- name: Push 22.04
run: |
docker push bshp/ocie:${{env.PREVIOUS_CHANNEL}}
- name: Build 24.04
run: |
docker build . --pull --build-arg OS_VERSION=${{env.CURRENT_CHANNEL}} --tag bshp/ocie:${{env.CURRENT_CHANNEL}} --no-cache
- name: Push 24.04
run: |
docker tag bshp/ocie:${{env.CURRENT_CHANNEL}} bshp/ocie:latest
docker push bshp/ocie:latest
docker push bshp/ocie:${{env.CURRENT_CHANNEL}}
- name: Dispatch Events
run: |
inheritees="apache2,ezproxy,itsm,mantis,unifi";
for inheritee in ${inheritees//,/ };do
echo "Sending event to [ bshp/${inheritee} ]";
curl -L -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: ${{secrets.WF_TOKEN}}" \
-H "X-OAuth-Scopes: repo, workflow" \
https://api.github.com/repos/bshp/${inheritee}/actions/workflows/build.yml/dispatches \
-d '{"ref":"main"}'
done;