mirror of https://github.com/crytic/echidna
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
2.5 KiB
90 lines
2.5 KiB
name: Docker
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- github-docker
|
|
- docker-slim
|
|
tags:
|
|
- '*'
|
|
|
|
env:
|
|
WORKFLOW_BUILD_DISTROLESS: false
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
id: buildx
|
|
with:
|
|
install: true
|
|
|
|
- name: Set Docker metadata (Ubuntu & NVM variant)
|
|
id: meta-ubuntu
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: |
|
|
ghcr.io/${{ github.repository }}/echidna
|
|
name=trailofbits/echidna,enable=${{ github.repository == 'crytic/echidna' }}
|
|
tags: |
|
|
type=ref,event=tag
|
|
type=ref,event=branch,prefix=testing-
|
|
type=edge
|
|
|
|
- name: Set Docker metadata (Distroless variant)
|
|
id: meta-distroless
|
|
uses: docker/metadata-action@v4
|
|
if: ${{ env.WORKFLOW_BUILD_DISTROLESS == true }}
|
|
with:
|
|
images: ghcr.io/${{ github.repository }}/distroless
|
|
tags: |
|
|
type=ref,event=tag
|
|
type=ref,event=branch,prefix=testing-
|
|
type=edge
|
|
|
|
- name: GitHub Container Registry Login
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Docker Hub Login
|
|
uses: docker/login-action@v2
|
|
if: github.repository == 'crytic/echidna'
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
|
|
|
|
- name: Docker Build and Push (Ubuntu & NVM variant)
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
platforms: linux/amd64
|
|
target: final-ubuntu
|
|
file: docker/Dockerfile
|
|
pull: true
|
|
push: true
|
|
tags: ${{ steps.meta-ubuntu.outputs.tags }}
|
|
labels: ${{ steps.meta-ubuntu.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
- name: Docker Build and Push (Distroless variant)
|
|
uses: docker/build-push-action@v3
|
|
if: ${{ env.WORKFLOW_BUILD_DISTROLESS == true }}
|
|
with:
|
|
platforms: linux/amd64
|
|
target: final-distroless
|
|
file: docker/Dockerfile
|
|
pull: true
|
|
push: true
|
|
tags: ${{ steps.meta-distroless.outputs.tags }}
|
|
labels: ${{ steps.meta-distroless.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|