@@ -3,15 +3,18 @@ name: Build and Release Resume
33on :
44 push :
55 branches : [main]
6+ paths :
7+ - ' **.tex'
8+ - ' **.cls'
9+ - ' **.sty'
10+ - ' .docker/**'
611 workflow_dispatch :
712
813jobs :
914 build :
1015 runs-on : ubuntu-latest
1116 permissions :
1217 contents : write
13- id-token : write
14- actions : write
1518 packages : write
1619
1720 steps :
@@ -20,49 +23,62 @@ jobs:
2023
2124 - name : Set up Docker Buildx
2225 uses : docker/setup-buildx-action@v3
26+ with :
27+ platforms : linux/amd64
28+ driver-opts : |
29+ image=moby/buildkit:master
30+ network=host
2331
24- - name : Login to GitHub Container Registry
32+ - name : Login to GHCR
2533 uses : docker/login-action@v3
2634 with :
2735 registry : ghcr.io
2836 username : ${{ github.actor }}
2937 password : ${{ secrets.GITHUB_TOKEN }}
3038
39+ - name : Cache Docker layers
40+ uses : actions/cache@v3
41+ with :
42+ path : /tmp/.buildx-cache
43+ key : ${{ runner.os }}-buildx-${{ github.sha }}
44+ restore-keys : |
45+ ${{ runner.os }}-buildx-
46+
3147 - name : Build and push Docker image
3248 uses : docker/build-push-action@v5
3349 with :
3450 context : .docker
3551 push : true
3652 tags : ghcr.io/${{ github.repository }}/latex-builder:latest
37- cache-from : type=registry,ref=ghcr.io/${{ github.repository }}/latex-builder:latest
38- cache-to : type=registry,ref=ghcr.io/${{ github.repository }}/latex-builder:latest,mode=max
53+ cache-from : |
54+ type=local,src=/tmp/.buildx-cache
55+ type=registry,ref=ghcr.io/${{ github.repository }}/latex-builder:latest
56+ cache-to : |
57+ type=local,dest=/tmp/.buildx-cache-new,mode=max
58+ type=registry,ref=ghcr.io/${{ github.repository }}/latex-builder:latest,mode=max
59+ build-args : |
60+ BUILDKIT_INLINE_CACHE=1
3961
40- - name : Build LaTeX document
62+ - name : Move cache
4163 run : |
42- docker run --rm -v ${{ github.workspace }}:/latex \
43- ghcr.io/${{ github.repository }}/latex-builder:latest \
44- /latex/entrypoint.sh "Anish_Shobith_P_S_Resume.pdf"
64+ rm -rf /tmp/.buildx-cache
65+ mv /tmp/.buildx-cache-new /tmp/.buildx-cache
4566
46- - name : Combine Metadata
47- id : metadata
67+ - name : Build LaTeX document
4868 run : |
49- echo "date=$(date +'%d-%m-%Y')" >> $GITHUB_OUTPUT
50- echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
69+ mkdir -p output
70+ docker run --rm -v ${{ github.workspace }}:/latex \
71+ ghcr.io/${{ github.repository }}/latex-builder:latest
5172
5273 - name : Create Release
5374 if : github.ref == 'refs/heads/main'
5475 uses : softprops/action-gh-release@v2
5576 with :
56- draft : false
57- prerelease : false
58- tag_name : v${{ steps.metadata.outputs.date }}
59- name : " Resume Update ${{ steps.metadata.outputs.date }}"
77+ tag_name : v$(date +'%Y.%m.%d')
78+ name : " Resume Update $(date +'%Y.%m.%d')"
6079 body : |
61- 📄 Resume update for ${{ steps.metadata.outputs.date }}
80+ 📄 Resume update $(date +'%Y.%m.%d')
6281
63- **Commit**: ${{ steps.metadata.outputs .sha }}
82+ **Commit**: ${{ github .sha }}
6483 **Branch**: main
65-
66- [View PDF](https://github.com/${{ github.repository }}/releases/download/v${{ steps.metadata.outputs.date }}/Anish_Shobith_P_S_Resume.pdf)
6784 files : Anish_Shobith_P_S_Resume.pdf
68- token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments