diff --git a/.docker/resume.dockerfile b/.docker/Dockerfile similarity index 57% rename from .docker/resume.dockerfile rename to .docker/Dockerfile index 3ca15d74..61900390 100644 --- a/.docker/resume.dockerfile +++ b/.docker/Dockerfile @@ -4,4 +4,6 @@ RUN apk add make texlive ENV TEXMF /usr/share/texmf-dist -COPY actions/entrypoint.sh /entrypoint.sh +WORKDIR /home/app/resume + +ENTRYPOINT ["make", "pdf", "html"] \ No newline at end of file diff --git a/.github/workflows/docker-update.yml b/.github/workflows/docker-update.yml deleted file mode 100644 index da2b72b3..00000000 --- a/.github/workflows/docker-update.yml +++ /dev/null @@ -1,55 +0,0 @@ -# This workflow updates the docker container which has context and -# pandoc installed, and on which the resume documents are built. The -# workflow runs whenever the dockerfile is changed, and updates the -# container image in the Github Packages registry. - -name: Publish Docker Image - -# Controls when the action will run. -on: - # Triggers the workflow on push events but only for the master branch - push: - branches: [ master ] - paths-ignore: - - 'markdown/**' - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - push_to_registry: - name: Push Docker image to GitHub Packages - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - steps: - - name: Check out the repo - uses: actions/checkout@v2 - - - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build and Push to GitHub Packages - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - context: . - file: .docker/resume.dockerfile - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 00000000..cbea13bc --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,35 @@ +name: Build inside docker image +on: + create: + workflow_dispatch: + push: + branches: [ master ] + paths: + - 'markdown/**' +env: + IMAGE_NAME: resume-image:${{github.sha}} +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --tag ${{env.IMAGE_NAME}} + working-directory: docker + - name: Build the Resume + run: docker run --rm -v ${PWD}:/home/app/resume ${{env.IMAGE_NAME}} + - name: Upload PDF + uses: actions/upload-artifact@v3 + with: + # Artifact name + name: Resume PDF # optional, default is artifact + # A file, directory or wildcard pattern that describes what to upload + path: output/*.pdf + - name: Upload HTML + uses: actions/upload-artifact@v3 + with: + # Artifact name + name: Resume HTML # optional, default is artifact + # A file, directory or wildcard pattern that describes what to upload + path: output/*.html \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 27512901..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: build-resume - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ master ] - paths: - - 'markdown/**' - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - build-resume: - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - - name: Test directory contents - run: 'ls -al' - - - name: Build resume - uses: ./actions - - - name: Upload a Build Artifact - uses: actions/upload-artifact@v2.2.3 - with: - # Artifact name - name: Resume PDF # optional, default is artifact - # A file, directory or wildcard pattern that describes what to upload - path: output/*.pdf - diff --git a/actions/action.yml b/actions/action.yml deleted file mode 100644 index 5da9ab10..00000000 --- a/actions/action.yml +++ /dev/null @@ -1,7 +0,0 @@ -# action.yml -name: 'Texlive Build' -description: 'Build a document using texlive' -runs: - using: 'docker' - image: 'docker://ghcr.io/mszep/pandoc_resume:master' - entrypoint: '/entrypoint.sh' diff --git a/actions/entrypoint.sh b/actions/entrypoint.sh deleted file mode 100755 index 087485a9..00000000 --- a/actions/entrypoint.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -sh -c "cd /home/app/resume && make pdf"