Create PR updating containers base image #1
This file contains hidden or 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 PR updating containers base image | |
| on: | |
| workflow_dispatch: | |
| branches: | |
| - master | |
| schedule: | |
| - cron: "0 0 1 * *" | |
| env: | |
| FEDORA_IMAGE: quay.io/fedora/fedora | |
| TAG: latest | |
| IMAGE_BASE: quay.io/keylime | |
| jobs: | |
| update-base-image: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| - name: Install skopeo and jq | |
| run: sudo apt-get install -y skopeo jq | |
| - name: Get hash of the latest stable version of Fedora | |
| run: echo "FEDORA_HASH=$(skopeo inspect docker://${{ env.FEDORA_IMAGE }}:${{ env.TAG }} | jq '.Digest')" >> "$GITHUB_ENV" | |
| - name: Update the Dockerfile template and CI Dockerfile | |
| run: | | |
| sed -i "s#\(FROM \)[^ ]*#\1${{ env.FEDORA_IMAGE }}@${{ env.FEDORA_HASH }}#" docker/release/base/Dockerfile.in | |
| sed -i "s#\(FROM \).*#\1${{ env.FEDORA_IMAGE }}@${{ env.FEDORA_HASH }}#" docker/ci/Dockerfile | |
| - name: Get current date for message | |
| id: date | |
| run: echo "DATE=$(date +"%Y-%m-%d")" >> "$GITHUB_ENV" | |
| - name: Create pull request | |
| uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f | |
| with: | |
| add-paths: | | |
| docker/release/base/Dockerfile.in | |
| docker/ci/Dockerfile | |
| title: "[Automatic] Update Keylime base image (${{ env.DATE }})" | |
| signoff: true | |
| body: | | |
| Automatically update the Keylime base image using: | |
| Base image: ${{ env.FEDORA_IMAGE }}@${{ env.FEDORA_HASH }} | |
| commit-message: | | |
| [Automatic] Update Keylime base image ${{ env.DATE }} | |
| Automatically update the Keylime base image using: | |
| Base image: ${{ env.FEDORA_IMAGE }}@${{ env.FEDORA_HASH }} | |