test cache #1
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: 'Cache test' | |
on: | |
push: {} | |
workflow_dispatch: {} | |
jobs: | |
check-env: | |
permissions: | |
contents: none | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
outputs: | |
check-docker: ${{ steps.check-docker.outputs.defined }} | |
steps: | |
- id: check-docker | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
if: ${{ env.DOCKER_USERNAME != '' }} | |
run: echo "defined=true" >> $GITHUB_OUTPUT | |
release: | |
runs-on: ubuntu-latest | |
needs: check-env | |
if: needs.check-env.outputs.check-docker == 'true' | |
timeout-minutes: 120 | |
permissions: | |
packages: write | |
contents: read | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Generate random cache | |
run: | | |
dd if=/dev/urandom of=randomfile bs=1M count=1 | |
- name: Save cache | |
uses: actions/cache@v4 | |
with: | |
path: randomfile | |
key: ${{ runner.os }}-${{ hashFiles('randomfile') }} |