wizardlm-13b Arena Human Preference 55K
how to write a github workfolw that can check if a docker image is updated since last…
- User
how to write a github workfolw that can check if a docker image is updated since last known version
- Assistant
To create a GitHub Workflow that checks if a Docker image has been updated since the last known version, you can follow these steps:
- Create a
docker-checkdirectory in your repository. - Inside the
docker-checkdirectory, create a file namedworkflow.ymlto define the GitHub Workflow. - Add the following content to
workflow.yml:
name: Docker Image Update Check on: push: branches: - main jobs: check-docker-image: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v2 - name: Log in to Docker Hub uses: docker/login-action@v1 with: username: ${{ docker.username }} password: ${{ docker.password }} email: ${{ docker.email }} - name: Pull latest image run: | docker pull $IMAGE_NAME:latest - name: Check image digest run: | docker image inspect --format='{{.ID}}:{{.Tag}}:{{.Digest}}' $IMAGE_NAME output: success_status: 0 json_events: true - name: Get known image digest id: get_known_digest run: | known_digest=$(cat known-digest.txt) env: - name: known_digest secret: name: known-digest - name: Check if image has been updated run: | if [[ "${AIR_GITHUB_COMMIT_SHA}" == "${known_digest}" ]]; then echo "Image has not been updated since last known version." exit 0 fi condition: ${{ github.event_name }} != "push" fail_fast: true message: "Image has been updated since last known version."- Replace
IMAGE_NAMEwith the name of your Docker image andIMAGE_TAGwith the tag of your image (usuallylatest). - Create
- Create a
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.