Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .actrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--container-architecture=linux/amd64
147 changes: 147 additions & 0 deletions .github/workflows/docker_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
on:
workflow_call:
inputs:
DOCKERHUB_USERNAME:
required: true
type: string
secrets:
DOCKERHUB_TOKEN:
required: true

env:
DOCKERHUB_ZONE: arylo
DOCKER_ROOT_PATH: ./src/docker
DOCKER_BUILD_CACHE_TAG: github-action-buildcache

jobs:
change_files:
runs-on: ubuntu-latest
outputs:
needPush: ${{ github.event_name == 'push' && github.ref_name == github.event.repository.default_branch }}
cronExecCodeChange: ${{ steps.cron-exec-code-changed-files.outputs.any_changed }}
cronExecReadmeChange: ${{ steps.cron-exec-readme-changed-files.outputs.any_changed }}
restartAfterChangeCodeChange: ${{ steps.restart-after-change-code-changed-files.outputs.any_changed }}
restartAfterChangeReadmeChange: ${{ steps.restart-after-change-readme-changed-files.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
- id: cron-exec-code-changed-files
uses: tj-actions/changed-files@v45
with:
files: |
${{ env.DOCKER_ROOT_PATH }}/cron-exec/**
!${{ env.DOCKER_ROOT_PATH }}/cron-exec/README.md
- id: cron-exec-readme-changed-files
uses: tj-actions/changed-files@v45
with:
files: |
${{ env.DOCKER_ROOT_PATH }}/cron-exec/README.md
- id: restart-after-change-code-changed-files
uses: tj-actions/changed-files@v45
with:
files: |
${{ env.DOCKER_ROOT_PATH }}/restart-after-change/**
!${{ env.DOCKER_ROOT_PATH }}/restart-after-change/README.md
- id: restart-after-change-readme-changed-files
uses: tj-actions/changed-files@v45
with:
files: |
${{ env.DOCKER_ROOT_PATH }}/restart-after-change/README.md

cron-exec-image:
env:
IMAGE_NAME: cron-exec
FOLDER_NAME: cron-exec
needs:
- change_files
if: needs.change_files.outputs.cronExecCodeChange == 'true'
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ inputs.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push image
uses: docker/build-push-action@v6
with:
push: ${{ needs.change_files.outputs.needPush == 'true' }}
load: true
context: "{{defaultContext}}:${{ env.DOCKER_ROOT_PATH }}/${{ env.FOLDER_NAME }}/"
tags: |
${{ env.DOCKERHUB_ZONE }}/${{ env.IMAGE_NAME }}:latest
${{ env.DOCKERHUB_ZONE }}/${{ env.IMAGE_NAME }}:alpine
${{ env.DOCKERHUB_ZONE }}/${{ env.IMAGE_NAME }}:alpine-3.9
cache-from: type=registry,ref=${{ env.DOCKERHUB_ZONE }}/${{ env.IMAGE_NAME }}:${{ env.DOCKER_BUILD_CACHE_TAG }}
cache-to: ${{ needs.change_files.outputs.needPush == 'true' && 'type=inline' || 'type=registry,ref=${{ env.DOCKERHUB_ZONE }}/${{ env.IMAGE_NAME }}:${{ env.DOCKER_BUILD_CACHE_TAG }},mode=max' }}
cron-exec-readme:
env:
IMAGE_NAME: cron-exec
FOLDER_NAME: cron-exec
needs:
- change_files
- cron-exec-image
if: always() && needs.change_files.outputs.cronExecReadmeChange == 'true' && github.event_name == 'push' && (needs.cron-exec-image.result == 'success' || needs.cron-exec-image.result == 'skipped') && github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update readme
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ inputs.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ env.DOCKERHUB_ZONE }}/${{ env.IMAGE_NAME }}
readme-filepath: ${{ env.DOCKER_ROOT_PATH }}/${{ env.FOLDER_NAME }}/README.md

restart-after-change-image:
env:
IMAGE_NAME: restart-after-change
FOLDER_NAME: restart-after-change
needs:
- change_files
- cron-exec-image
if: always() && needs.change_files.outputs.restartAfterChangeCodeChange == 'true' && (needs.cron-exec-image.result == 'success' || needs.cron-exec-image.result == 'skipped')
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ inputs.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push image
uses: docker/build-push-action@v6
with:
push: ${{ needs.change_files.outputs.needPush == 'true' }}
load: true
context: "{{defaultContext}}:${{ env.DOCKER_ROOT_PATH }}/${{ env.FOLDER_NAME }}/"
tags: |
${{ env.DOCKERHUB_ZONE }}/${{ env.IMAGE_NAME }}:latest
${{ env.DOCKERHUB_ZONE }}/${{ env.IMAGE_NAME }}:alpine
${{ env.DOCKERHUB_ZONE }}/${{ env.IMAGE_NAME }}:alpine-3.9
cache-from: type=registry,ref=${{ env.DOCKERHUB_ZONE }}/${{ env.IMAGE_NAME }}:${{ env.DOCKER_BUILD_CACHE_TAG }}
cache-to: ${{ needs.change_files.outputs.needPush == 'true' && 'type=inline' || 'type=registry,ref=${{ env.DOCKERHUB_ZONE }}/${{ env.IMAGE_NAME }}:${{ env.DOCKER_BUILD_CACHE_TAG }},mode=max' }}
restart-after-change-readme:
env:
IMAGE_NAME: restart-after-change
FOLDER_NAME: restart-after-change
needs:
- change_files
- restart-after-change-image
if: always() && needs.change_files.outputs.restartAfterChangeReadmeChange == 'true' && github.event_name == 'push' && (needs.restart-after-change-image.result == 'success' || needs.restart-after-change-image.result == 'skipped') && github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update readme
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ inputs.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ env.DOCKERHUB_ZONE }}/${{ env.IMAGE_NAME }}
readme-filepath: ${{ env.DOCKER_ROOT_PATH }}/${{ env.FOLDER_NAME }}/README.md
18 changes: 18 additions & 0 deletions .github/workflows/monkey_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
workflow_call:

jobs:
monkey_push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Build Scripts
run: npm run build:monkey
- name: Deploy Monkey scripts
if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist/monkey
branch: monkey
Loading