build(Dockerfile): bump python latest tag digest (#255) #100
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: build rwalk | |
"on": | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- LICENSE | |
- README.md | |
- fly.toml | |
- .github/workflows/build.yml | |
- .github/workflows/deploy.yml | |
- .github/workflows/digesta.yml | |
- .github/dependabot.yml | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
name: build rwalk | |
permissions: | |
contents: read | |
packages: write | |
outputs: | |
digest: ${{ steps.docker.outputs.digest }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout project | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
- name: setup python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b | |
with: | |
python-version: '3.9' | |
- name: install poetry | |
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a | |
with: | |
virtualenvs-create: false | |
- name: export requirements.txt | |
run: | | |
poetry export -o requirements.txt | |
- name: install cosign | |
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da | |
- name: verify base images | |
run: | | |
cosign dockerfile verify \ | |
--certificate-identity \ | |
'https://github.com/chainguard-images/images/.github/workflows/release.yaml@refs/heads/main' \ | |
--certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \ | |
Dockerfile | jq . | |
- name: docker buildx | |
id: buildx | |
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 | |
- name: login ghcr.io | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: docker metadata | |
id: meta | |
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 | |
with: | |
images: ${{ env.IMAGE_NAME }} | |
- name: build rwalk (devel) | |
id: docker | |
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 | |
with: | |
context: . | |
push: true | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:devel | |
labels: ${{ steps.meta.outputs.labels }} | |
builder: ${{ steps.buildx.outputs.name }} | |
sbom: true | |
provenance: true | |
- name: smoke test | |
run: | | |
set -x | |
docker run --rm --detach -p 8080:8080 --name smoke_rwalk \ | |
"${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.docker.outputs.digest }}" | |
sleep 3 | |
curl -X GET http://localhost:8080 || (docker logs smoke_rwalk && exit 1) | |
docker logs smoke_rwalk | |
docker stop smoke_rwalk | |
cosign: | |
name: cosign rwalk | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
packages: write | |
needs: build | |
steps: | |
- name: install cosign | |
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da | |
- name: login ghcr.io | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: cosign rwalk | |
run: | | |
cosign sign -y "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ needs.build.outputs.digest }}" | |
- name: install crane | |
uses: imjasonh/setup-crane@31b88efe9de28ae0ffa220711af4b60be9435f6e | |
- name: tag rwalk (latest) | |
run: | | |
crane tag "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:devel" latest |