From 71f10a0a9fac9b6749cbee0b008bcaea1fc116b0 Mon Sep 17 00:00:00 2001 From: Vladimir Rubin Date: Thu, 28 Nov 2024 10:04:46 +0200 Subject: [PATCH] ci(docker): add autobuild dockerimages --- .gitea/workflows/docker.yaml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .gitea/workflows/docker.yaml diff --git a/.gitea/workflows/docker.yaml b/.gitea/workflows/docker.yaml new file mode 100644 index 0000000..9036f6a --- /dev/null +++ b/.gitea/workflows/docker.yaml @@ -0,0 +1,33 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - main # Change this to your default branch if different + +jobs: + build: + name: Build and Push Image + runs-on: ubuntu-latest-root # This specifies the environment for the job + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: gitea.haientus.duckdns.org # Replace with your Docker registry URL + username: ${{ gitea.actor }} # The actor who triggered the action + password: ${{ secrets.REGISTRY_TOKEN }} # Your registry token secret + + - name: Build Docker Image + run: | + TODAY=$(date +'%Y-%m-%d') + docker build -t gitea.haientus.duckdns.org/${{ gitea.repository_owner }}/exmr:${TODAY} . + docker tag gitea.haientus.duckdns.org/${{ gitea.repository_owner }}/exmr:${TODAY} gitea.haientus.duckdns.org/${{ gitea.repository_owner }}/exmr:latest + + - name: Push Docker Image + run: | + docker push gitea.haientus.duckdns.org/${{ gitea.repository_owner }}/exmr:${TODAY} + docker push gitea.haientus.duckdns.org/${{ gitea.repository_owner }}/exmr:latest