mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
[ci] Attempt to move to reusable workflows
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
name: Build Docker Image
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
arch:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
name: Build Docker image
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
-
|
||||
name: Login to Registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ${{ secrets.REGISTRY_URL }}
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
-
|
||||
name: Get short commit SHA
|
||||
id: commit_sha
|
||||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
platforms: linux/${{ inputs.arch }}
|
||||
push: ${{ github.ref == 'refs/heads/dev' }}
|
||||
tags: ${{ secrets.REGISTRY_URL }}/west/telegram-bot:latest,
|
||||
${{ secrets.REGISTRY_URL }}/west/telegram-bot:${{ steps.commit_sha.outputs.sha_short }}
|
||||
Reference in New Issue
Block a user