From bb69d9f5ecd43bc6e8bb39ecd2f98e06ad40a5d4 Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 27 Aug 2024 18:53:17 -0700 Subject: [PATCH] Job for pushing to docker hub --- .gitea/workflows/hugo-builder.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/hugo-builder.yml b/.gitea/workflows/hugo-builder.yml index eff42fc..e09de4f 100644 --- a/.gitea/workflows/hugo-builder.yml +++ b/.gitea/workflows/hugo-builder.yml @@ -3,6 +3,8 @@ on: push: branches: - master +env: + image: shockrah/hugo jobs: build-hugo-image: @@ -10,9 +12,16 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v4 - - name: General Docker Info - run: docker info - - name: Find all files in repo space - run: ls -lrt ${{ gitea.workspace }} - - name: Attempt a docker build - run: docker build -t shockrah/hugo ${{ gitea.workspace }}/website + - name: Build docker image + run: docker build -t ${{ env.image }} ${{ gitea.workspace }}/website + push-to-docker-hub: + needs: build-hugo-image + runs-on: ubuntu-latest + steps: + - name: Login to Docker Hub + run: | + echo "${{ secrets.dockerhub_pass }}" | \ + docker login -u ${{ secrets.dockerhub_user }} --password-stdin + - name: Push Docker image from previous job + run: docker push ${{ env.image }} +