diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 27da4b1..1f6c52c 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -11,20 +11,18 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag latex-resume:latest + - name: Build the Docker image + run: docker build . --file Dockerfile --tag latex-resume:latest - - name: Run Docker container to generate PDF and PNG - run: docker run --rm -v ${{ github.workspace }}:/data latex-resume:latest + - name: Run Docker container to generate PDF and PNG + run: docker run --rm -v ${{ github.workspace }}/src:/data latex-resume:latest - - name: Commit PDF and PNG files - run: | - git config --global user.name 'github-actions' - git config --global user.email 'github-actions@github.com' - git add main.pdf main.png - git commit -m 'Auto-generated PDF and PNG' - git push - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Commit PDF and PNG files (assuming GITHUB_TOKEN is a secret) + run: | + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' + git add src/main.pdf src/main.png # Adjust paths if needed + git commit -m 'Auto-generated PDF and PNG' + git push diff --git a/Dockerfile b/Dockerfile index c65ed2b..13eb846 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,13 +6,14 @@ RUN apt-get update && \ apt-get install -y imagemagick texlive-fonts-extra # Set the working directory -WORKDIR /data +WORKDIR /data/latex # Create a dedicated directory for LaTeX files # Copy your LaTeX files into the container -COPY . /data +COPY . /data/latex # Build the LaTeX document RUN pdflatex main.tex -# Set the default command to convert PDF to PNG -CMD ["convert", "-density", "300", "main.pdf", "-quality", "90", "main.png"] +# Convert PDF to PNG (executed outside the container for more control) +# (Optional: Remove CMD if you execute this command in your workflow) +# CMD ["convert", "-density", "300", "main.pdf", "-quality", "90", "main.png"]