From 01ab652392c895f2c9cdafba5172f9cdd90f51db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20M=C4=99dryga=C5=82?= Date: Wed, 27 Mar 2024 13:39:48 +0100 Subject: [PATCH] chore: changed docker image job --- .github/actions/docker/prepare.yml | 21 +++++++++++++++++++++ .github/workflows/docker-image.yml | 14 ++++---------- 2 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 .github/actions/docker/prepare.yml diff --git a/.github/actions/docker/prepare.yml b/.github/actions/docker/prepare.yml new file mode 100644 index 00000000..d47d3502 --- /dev/null +++ b/.github/actions/docker/prepare.yml @@ -0,0 +1,21 @@ +name: Prepare docker +description: Specific steps to prepare docker environment +inputs: + username: + required: true + password: + required: true +runs: + using: "composite" + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ inputs.username }} + password: ${{ inputs.password }} diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index a0549f11..4fb238d8 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -13,21 +13,15 @@ on: workflow_dispatch # - release/* jobs: - run: + build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub - uses: docker/login-action@v3 + - name: Prepare docker + uses: ./.github/actions/docker with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Create image tag + - name: Generate tag env: IMAGE_TAG: '${{ github.ref_name }}' run: echo "IMAGE_TAG=${IMAGE_TAG/\//-}" >> $GITHUB_ENV