From 516b493b4749b292cea0fb8b372e8e8a2ef1bf85 Mon Sep 17 00:00:00 2001 From: skeris Date: Wed, 30 Oct 2024 00:53:40 +0300 Subject: [PATCH] move build image workflow to reusing repo --- .gitea/workflows/build-image.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .gitea/workflows/build-image.yml diff --git a/.gitea/workflows/build-image.yml b/.gitea/workflows/build-image.yml new file mode 100644 index 0000000..7666d99 --- /dev/null +++ b/.gitea/workflows/build-image.yml @@ -0,0 +1,28 @@ +name: Build Image +run-name: ${{ gitea.actor }} build image and push to container registry +on: + workflow_call: + secrets: + REGISTRY_USER: + required: true + REGISTRY_PASSWORD: + required: true + +jobs: + Build-Image: + runs-on: [self-hosted] + steps: + - run: echo "The job was automatically triggered by a ${{ gitea.event_name }} event." + - run: echo "This job is now running on a ${{ runner.os }} server hosted by Gitea!" + - run: echo "The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." + - name: Check out repository code + uses: http://gitea.pena:3000/PenaDevops/actions.git/checkout@v1 + - run: echo "The workflow is now ready to test your code on the runner." + - run: podman login -u ${{ secrets.REGISTRY_USER }} -p ${{ secrets.REGISTRY_PASSWORD }} gitea.pena:3000 + - name: set lower case repository + run: | + echo "REPOSITORY_LC=${REPOSITORY,,}" >>${GITEA_ENV} + env: + REPOSITORY: '${{ gitea.repository }}' + - run: podman build -t gitea.pena:3000/${{ env.REPOSITORY_LC }}/${{ gitea.ref_name }}:${{ gitea.run_id }} . + - run: podman push gitea.pena:3000/${{ env.REPOSITORY_LC }}/${{ gitea.ref_name }}:${{ gitea.run_id }}