diff --git a/.github/workflows/docker_build_push.yml b/.github/workflows/docker_build_push.yml index c962eea6..ea4c57c3 100644 --- a/.github/workflows/docker_build_push.yml +++ b/.github/workflows/docker_build_push.yml @@ -29,7 +29,7 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: # Latest for main, else branch name - type=raw,value=${{ github.ref}},enable=${{ github.ref != format('refs/heads/{0}', 'main') }} + type=raw,value=${{ github.ref}} type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} - name: Build and push Docker image diff --git a/.github/workflows/validate-book-build.yml b/.github/workflows/validate-book-build.yml index 22dc3c17..c4cc4707 100644 --- a/.github/workflows/validate-book-build.yml +++ b/.github/workflows/validate-book-build.yml @@ -1,21 +1,21 @@ name: Validate LaTeX Document on: - push: - branches: - - '**' # All branches - - '!main' # But main as will do it anyway and more in release_book pull_request: jobs: test_building_book: runs-on: ubuntu-latest + env: + IMAGE: ghcr.io/hendricius/the-sourdough-framework:${{ github.ref_slug }} steps: - name: Set up git repository uses: actions/checkout@v3 + - name: Build and Push Docker Image + uses: ./.github/workflows/docker_build_push.yml - name: Print dependency versions uses: addnab/docker-run-action@v3 with: - image: ghcr.io/hendricius/the-sourdough-framework:latest + image: ${{ ENV.IMAGE }} options: -v ${{ github.workspace }}:/app run: | cd /app/book @@ -23,7 +23,7 @@ jobs: - name: Print build variables uses: addnab/docker-run-action@v3 with: - image: ghcr.io/hendricius/the-sourdough-framework:latest + image: ${{ ENV.IMAGE }} options: -v ${{ github.workspace }}:/app run: | cd /app/book @@ -31,7 +31,7 @@ jobs: - name: Test baking the release versions uses: addnab/docker-run-action@v3 with: - image: ghcr.io/hendricius/the-sourdough-framework:latest + image: ${{ ENV.IMAGE }} options: -v ${{ github.workspace }}:/app run: | cd /app/book @@ -39,7 +39,7 @@ jobs: - name: Test building website uses: addnab/docker-run-action@v3 with: - image: ghcr.io/hendricius/the-sourdough-framework:latest + image: ${{ ENV.IMAGE }} options: -v ${{ github.workspace }}:/app run: | cd /app/book