Docker CI #252
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- '.gitignore' | |
- '**.md' | |
schedule: | |
- cron: '15 2 * * *' | |
env: | |
BETA_CHANNEL: 24.04 | |
STABLE_CHANNEL: 22.04 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Configure Docker | |
env: | |
DOCKER_USER: ${{secrets.DOCKER_USER}} | |
DOCKER_TOKEN: ${{secrets.DOCKER_TOKEN}} | |
run: | | |
docker login -u $DOCKER_USER -p $DOCKER_TOKEN | |
- name: Build 22.04 | |
run: | | |
docker build . --pull --build-arg OS_VERSION=${{env.STABLE_CHANNEL}} --tag bshp/ocie:latest --no-cache | |
- name: Push 22.04 | |
run: | | |
docker tag bshp/ocie:latest bshp/ocie:${{env.STABLE_CHANNEL}} | |
docker push bshp/ocie:latest | |
docker push bshp/ocie:${{env.STABLE_CHANNEL}} | |
# - name: Build 24.04 | |
# run: | | |
# docker build . --pull --build-arg OS_VERSION=${{env.BETA_CHANNEL}} --tag bshp/ocie:beta --no-cache | |
# - name: Push 24.04 | |
# run: | | |
# docker tag bshp/ocie:beta bshp/ocie:${{env.BETA_CHANNEL}} | |
# docker push bshp/ocie:beta | |
# docker push bshp/ocie:${{env.BETA_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-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/bshp/${inheritee}/actions/workflows/build.yml/dispatches \ | |
-d '{"ref":"main"}' | |
done; |