Skip to content

Execute docker build and push using docker caches (with multi stage).

License

Notifications You must be signed in to change notification settings

devmasx/cached-docker-build-push

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cached docker build push

Execute docker build and push using docker caches.

Github Action

Build and push

- uses: devmasx/[email protected]
  with:
    image_name: devmasx/project-name
    push: true

Build with multiple options

- uses: devmasx/[email protected]
  with:
    image_name: devmasx/project-name-web
    image_tag: ${{ github.sha }}
    file: Dockerfile.web
    cache_stage_target: builder
    build_params: --build-arg=NPM_TOKEN=${{secrets.NPM_TOKEN}}
    push: true

Use your own docker authentication for private repositories Examples:

Azure

- run: az acr login --name myregistry
- uses: devmasx/[email protected]
  with:
    image_name: devmasx/project-name

Google cloud

- run: gcloud auth configure-docker
- uses: devmasx/[email protected]
  with:
    image_name: devmasx/project-name

Docker Hub

- run: |
  docker login -u ${{secrets.DOCKER_USERNAME}} -p ${{secrets.DOCKER_PASSWORD}}
- uses: devmasx/[email protected]
  with:
    image_name: devmasx/project-name