name: Build and push Docker images on: push: tags: - 'v*' jobs: docker: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Extract version from tag id: version run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" - name: Build and push standard image uses: docker/build-push-action@v6 with: context: ./ file: ./Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: | apotdevin/thunderhub:${{ steps.version.outputs.version }} apotdevin/thunderhub:latest cache-from: type=gha cache-to: type=gha,mode=max - name: Build and push base-path image uses: docker/build-push-action@v6 with: context: ./ file: ./Dockerfile platforms: linux/amd64,linux/arm64 push: true build-args: BASE_PATH=/thub tags: | apotdevin/thunderhub:base-${{ steps.version.outputs.version }} cache-from: type=gha cache-to: type=gha,mode=max