Skip to content

Commit

Permalink
Update publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
markusweigelt authored Jun 19, 2023
1 parent 27999cf commit b372d20
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,20 @@ jobs:
with:
ref: ${{ github.event.inputs.checkout-ref }}

- name: Determine build args
- name: Determine environment variables
run: |
date -u +"build_date=%Y-%m-%dT%H:%M:%SZ" >> $GITHUB_ENV
echo "vcs_ref=`git rev-parse --short HEAD`" >> $GITHUB_ENV
echo "$vcs_ref" > /tmp/${{ github.event.inputs.image-tag }}-vcs-ref # temporary file to fill cache
LOCAL_VSC_REF=`git rev-parse --short HEAD`
echo "vcs_ref=$LOCAL_VSC_REF" >> $GITHUB_ENV
echo "cache_key=${{ github.event.inputs.image-tag }}-$LOCAL_VSC_REF" >> $GITHUB_ENV # (input image-tag - vcs_ref)
echo "$LOCAL_VSC_REF" > /tmp/${{ github.event.inputs.image-tag }}-vcs-ref # temporary file to fill cache
- name: Get cache key "${{ github.event.inputs.image-tag }}-${{ env.vcs_ref }}" (input image-tag - vcs_ref)
- name: Get cache key "${{ env.cache_key }}"
uses: actions/cache/restore@v3
id: cache
with:
path: /tmp/${{ github.event.inputs.image-tag }}-vcs-ref
key: ${{ github.event.inputs.image-tag }}-${{ env.vcs_ref }}
key: ${{ env.cache_key }}
lookup-only: true

- # Activate cache export feature to reduce build time of images
Expand Down Expand Up @@ -67,9 +69,9 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Save cache key "${{ github.event.inputs.image-tag }}-${{ env.vcs_ref }}" (input image-tag - vcs_ref)
- name: Save cache key "${{ env.cache_key }}"
uses: actions/cache/save@v3
if: steps.cache.outputs.cache-hit != 'true'
with:
path: /tmp/${{ github.event.inputs.image-tag }}-vcs-ref
key: ${{ github.event.inputs.image-tag }}-${{ env.vcs_ref }}
key: ${{ env.cache_key }}

0 comments on commit b372d20

Please sign in to comment.