[ci] Attempt to move to reusable workflows

This commit is contained in:
West14
2022-01-10 15:09:19 +02:00
parent bd052cf377
commit f9dcc4e083
3 changed files with 35 additions and 5 deletions
+41
View File
@@ -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 }}