Create Pdf #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Pdf | |
on: | |
workflow_dispatch: | |
inputs: | |
template-name: | |
required: true | |
type: choice | |
options: | |
- Raul-Otano.en | |
jobs: | |
build-push-image: | |
name: Build and push image | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build Pdf | |
run: | | |
docker container create -e SECRETS="${{ secrets.SECRETS }}" -it --name cv rulyotano/latex-builder:6539225451 './${{ inputs.template-name }}.tex' | |
docker cp ./templates/${{ inputs.template-name }}.tex cv:/var/build/${{ inputs.template-name }}.tex | |
docker container start -a cv | |
mkdir out | |
docker cp cv:/var/build/${{ inputs.template-name }}.pdf ./out/ | |
docker container rm cv | |
- name: Push to private repo | |
uses: cpina/github-action-push-to-another-repository@master | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | |
with: | |
source-directory: 'out' | |
target-branch: ${{ inputs.template-name }} | |
destination-github-username: 'rulyotano' | |
destination-repository-name: 'cv-private' | |
user-email: rulyotano@gmail.com | |
commit-message: Update file '${{ inputs.template-name }}.pdf'. Id ${{ github.run_id }} | |
- name: Test get variable exported by push-to-another-repository | |
run: echo $DESTINATION_CLONED_DIRECTORY |