From fcd8469dce463aaebf67ba859eadf59ab812b1f5 Mon Sep 17 00:00:00 2001 From: ties Date: Tue, 27 Aug 2024 07:59:39 +0000 Subject: [PATCH] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index c2134be..d2b43e3 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -1,23 +1,31 @@ +name: Build docker container on: push: + branches: + - main jobs: build: + name: Build image runs-on: ubuntu-latest + container: ghcr.io/catthehacker/ubuntu:act-latest + env: + IMAGE_NAME: example-image + REGISTRY: git.ties.one + REPO_OWNER: public steps: - name: Checkout uses: actions/checkout@v4 - - name: Login to Docker Hub uses: docker/login-action@v3 with: registry: https://git.ties.one username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: https://git.ties.one/public/custom_act_runner:latest \ No newline at end of file + run: | + TODAY=$(date +'%Y-%m-%d') + docker build -t ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:${TODAY} -t ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:latest . + docker push ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:${TODAY} + docker push ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:latest + \ No newline at end of file