Simplify container #3
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: Container slim | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
workflow_dispatch: | |
env: | |
IMAGE_NAME: pynucleus | |
IMAGE_TAGS: latest ${{ github.sha }} | |
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} | |
REGISTRY_USER: ${{ github.actor }} | |
REGISTRY_PASSWORD: ${{ github.token }} | |
jobs: | |
container: | |
runs-on: ubuntu-latest | |
timeout-minutes: 300 | |
steps: | |
- name: Set environment variables for PR | |
run: | | |
echo "IMAGE_TAGS=pr" >> $GITHUB_ENV | |
- name: Pull image | |
run: | | |
docker pull ghcr.io/sandialabs/pynucleus:latest | |
- name: Slim the image | |
uses: kitabisa/docker-slim-action@v1 | |
env: | |
DSLIM_HTTP_PROBE: false | |
with: | |
target: ghcr.io/sandialabs/pynucleus:latest | |
tag: "slim-latest" | |
# - name: Push To GHCR | |
# uses: redhat-actions/push-to-registry@v2 | |
# with: | |
# image: pynucleus | |
# tags: slim-latest | |
# registry: ${{ env.IMAGE_REGISTRY }} | |
# username: ${{ env.REGISTRY_USER }} | |
# password: ${{ env.REGISTRY_PASSWORD }} | |
# extra-args: | | |
# --disable-content-trust |