From f9dcc4e08397fb2343f001e4c09a68fcefa6e8cb Mon Sep 17 00:00:00 2001 From: West14 <30056636+West14@users.noreply.github.com> Date: Mon, 10 Jan 2022 15:09:19 +0200 Subject: [PATCH] [ci] Attempt to move to reusable workflows --- .github/workflows/build-amd64.yml | 14 ++++++++++++++ .github/workflows/build-arm64.yml | 14 ++++++++++++++ .github/workflows/{build-image.yml => build.yml} | 12 +++++++----- 3 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/build-amd64.yml create mode 100644 .github/workflows/build-arm64.yml rename .github/workflows/{build-image.yml => build.yml} (86%) diff --git a/.github/workflows/build-amd64.yml b/.github/workflows/build-amd64.yml new file mode 100644 index 0000000..ee7233a --- /dev/null +++ b/.github/workflows/build-amd64.yml @@ -0,0 +1,14 @@ +name: Build Docker Image + +on: + push: + +jobs: + docker: + name: Build Docker image + + runs-on: [linux, x64] + steps: + - uses: ./.github/workflows/build@dev + with: + arch: amd64 \ No newline at end of file diff --git a/.github/workflows/build-arm64.yml b/.github/workflows/build-arm64.yml new file mode 100644 index 0000000..7568f7c --- /dev/null +++ b/.github/workflows/build-arm64.yml @@ -0,0 +1,14 @@ +name: Build Docker Image + +on: + push: + +jobs: + docker: + name: Build Docker image + + runs-on: [self-hosted, linux, arm64] + steps: + - uses: ./.github/workflows/build@dev + with: + arch: arm64 \ No newline at end of file diff --git a/.github/workflows/build-image.yml b/.github/workflows/build.yml similarity index 86% rename from .github/workflows/build-image.yml rename to .github/workflows/build.yml index 66294c5..ef75abe 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build.yml @@ -1,13 +1,15 @@ -name: ci +name: Build Docker Image on: - push: + workflow_call: + inputs: + arch: + required: true + type: string jobs: docker: name: Build Docker image - - runs-on: [self-hosted, linux, ARM64] steps: - name: Checkout @@ -33,7 +35,7 @@ jobs: name: Build and push uses: docker/build-push-action@v2 with: - platforms: linux/amd64,linux/arm64 + 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 }} \ No newline at end of file