Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
typhonshambo committed May 16, 2024
1 parent 09cbb20 commit cbef107
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 '[email protected]'
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 '[email protected]'
git add src/main.pdf src/main.png # Adjust paths if needed
git commit -m 'Auto-generated PDF and PNG'
git push
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit cbef107

Please sign in to comment.