test new workflow
This commit is contained in:
@@ -8,73 +8,19 @@ on:
|
|||||||
- 'docker/Dockerfile'
|
- 'docker/Dockerfile'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
force_rebuild:
|
no_cache:
|
||||||
description: 'Force rebuild without cache'
|
description: 'Force rebuild without cache'
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
# Runs directly on runner host — buildah+skopeo available via tools volume
|
uses: docker/image-builder/.gitea/workflows/build.yaml@main
|
||||||
# No container spawned, no internet required in container
|
with:
|
||||||
runs-on: docker
|
image_name: ansible-act-runner
|
||||||
|
dockerfile_path: docker/Dockerfile
|
||||||
steps:
|
context_path: docker/
|
||||||
- name: 🔎 Checkout
|
no_cache: ${{ inputs.no_cache || false }}
|
||||||
run: |
|
secrets:
|
||||||
git clone \
|
TOKEN: ${{ secrets.TOKEN }}
|
||||||
--depth 1 \
|
|
||||||
--branch "${{ gitea.ref_name }}" \
|
|
||||||
"http://${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PASSWORD }}@gitea.mod.home/ansible/ansible-runner.git" \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: 🏷️ Set Image Tags
|
|
||||||
id: tags
|
|
||||||
run: |
|
|
||||||
REGISTRY="gitea.mod.home"
|
|
||||||
ORG="${{ gitea.repository_owner }}"
|
|
||||||
IMAGE="ansible-act-runner"
|
|
||||||
SHORT_SHA="${{ gitea.sha }}"
|
|
||||||
SHORT_SHA="${SHORT_SHA:0:8}"
|
|
||||||
|
|
||||||
echo "tag_latest=${REGISTRY}/${ORG}/${IMAGE}:latest" >> $GITHUB_OUTPUT
|
|
||||||
echo "tag_sha=${REGISTRY}/${ORG}/${IMAGE}:${SHORT_SHA}" >> $GITHUB_OUTPUT
|
|
||||||
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: 🔨 Build Image
|
|
||||||
run: |
|
|
||||||
BUILD_ARGS=""
|
|
||||||
if [ "${{ inputs.force_rebuild }}" = "true" ]; then
|
|
||||||
BUILD_ARGS="--no-cache"
|
|
||||||
fi
|
|
||||||
|
|
||||||
buildah bud \
|
|
||||||
--storage-driver vfs \
|
|
||||||
${BUILD_ARGS} \
|
|
||||||
-t ${{ steps.tags.outputs.tag_latest }} \
|
|
||||||
-t ${{ steps.tags.outputs.tag_sha }} \
|
|
||||||
-f docker/Dockerfile \
|
|
||||||
docker/
|
|
||||||
|
|
||||||
- name: 📤 Push Image → Gitea Registry
|
|
||||||
run: |
|
|
||||||
skopeo copy \
|
|
||||||
--dest-tls-verify=false \
|
|
||||||
--dest-creds "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PASSWORD }}" \
|
|
||||||
containers-storage:${{ steps.tags.outputs.tag_latest }} \
|
|
||||||
docker://${{ steps.tags.outputs.tag_latest }}
|
|
||||||
|
|
||||||
skopeo copy \
|
|
||||||
--dest-tls-verify=false \
|
|
||||||
--dest-creds "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PASSWORD }}" \
|
|
||||||
containers-storage:${{ steps.tags.outputs.tag_sha }} \
|
|
||||||
docker://${{ steps.tags.outputs.tag_sha }}
|
|
||||||
|
|
||||||
- name: 📨 Telegram Notification
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
curl -s -X POST \
|
|
||||||
"https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
|
|
||||||
-d "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" \
|
|
||||||
-d "text=🐳 Build ansible-act-runner:${{ steps.tags.outputs.short_sha }} — ${{ job.status }}"
|
|
||||||
|
|||||||
@@ -10,59 +10,10 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
# Runs directly on runner host — buildah+skopeo available via tools volume
|
uses: docker/image-builder/.gitea/workflows/build.yaml@main
|
||||||
# No container spawned, no internet required in container
|
with:
|
||||||
runs-on: docker
|
image_name: ubuntu-act-runner
|
||||||
|
dockerfile_path: docker-ubuntu-latest/Dockerfile
|
||||||
steps:
|
context_path: docker-ubuntu-latest/
|
||||||
- name: 🔎 Checkout
|
secrets:
|
||||||
run: |
|
TOKEN: ${{ secrets.TOKEN }}
|
||||||
git clone \
|
|
||||||
--depth 1 \
|
|
||||||
--branch "${{ gitea.ref_name }}" \
|
|
||||||
"http://${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PASSWORD }}@gitea.mod.home/ansible/ansible-runner.git" \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: 🏷️ Set Image Tags
|
|
||||||
id: tags
|
|
||||||
run: |
|
|
||||||
REGISTRY="gitea.mod.home"
|
|
||||||
ORG="${{ gitea.repository_owner }}"
|
|
||||||
IMAGE="ubuntu-act-runner"
|
|
||||||
SHORT_SHA="${{ gitea.sha }}"
|
|
||||||
SHORT_SHA="${SHORT_SHA:0:8}"
|
|
||||||
|
|
||||||
echo "tag_latest=${REGISTRY}/${ORG}/${IMAGE}:latest" >> $GITHUB_OUTPUT
|
|
||||||
echo "tag_sha=${REGISTRY}/${ORG}/${IMAGE}:${SHORT_SHA}" >> $GITHUB_OUTPUT
|
|
||||||
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: 🔨 Build Image
|
|
||||||
run: |
|
|
||||||
buildah bud \
|
|
||||||
--storage-driver vfs \
|
|
||||||
-t ${{ steps.tags.outputs.tag_latest }} \
|
|
||||||
-t ${{ steps.tags.outputs.tag_sha }} \
|
|
||||||
-f docker-ubuntu-latest/Dockerfile \
|
|
||||||
docker-ubuntu-latest/
|
|
||||||
|
|
||||||
- name: 📤 Push Image → Gitea Registry
|
|
||||||
run: |
|
|
||||||
skopeo copy \
|
|
||||||
--dest-tls-verify=false \
|
|
||||||
--dest-creds "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PASSWORD }}" \
|
|
||||||
containers-storage:${{ steps.tags.outputs.tag_latest }} \
|
|
||||||
docker://${{ steps.tags.outputs.tag_latest }}
|
|
||||||
|
|
||||||
skopeo copy \
|
|
||||||
--dest-tls-verify=false \
|
|
||||||
--dest-creds "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PASSWORD }}" \
|
|
||||||
containers-storage:${{ steps.tags.outputs.tag_sha }} \
|
|
||||||
docker://${{ steps.tags.outputs.tag_sha }}
|
|
||||||
|
|
||||||
- name: 📨 Telegram Notification
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
curl -s -X POST \
|
|
||||||
"https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
|
|
||||||
-d "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" \
|
|
||||||
-d "text=🐳 Build ubuntu-act-runner:${{ steps.tags.outputs.short_sha }} — ${{ job.status }}"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user