Skip to content

Update docker-build.yml #21

Update docker-build.yml

Update docker-build.yml #21

Workflow file for this run

name: Build ArkimeViewer docker Image
on:
# All thoses triggers might be too much, subject to change
push:
pull_request:
release:
types: [published, created, edited]
label:
types: [created, edited]
workflow_dispatch:
jobs:
push_to_registry:
name: Push Docker image to GitHub Container Registry
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
-
name: Check out the repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
-
name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Log in to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: PrepareReg Names
run: |
# Change all uppercase to lowercase
OWNER=$(echo ${{ github.repository_owner }} | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && LATEST="latest"
echo "OWNER=$OWNER" >> $GITHUB_ENV
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "OWNER=$OWNER"
echo "VERSION=$VERSION"
-
name: Build container image
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991
with:
context : ./docker/Arkime
file : ./docker/Arkime/Arkime.dockerfile
push: true
tags: |
ghcr.io/${{ env.OWNER }}/arkimeviewer:${{ github.sha }}
ghcr.io/${{ env.OWNER }}/arkimeviewer:${{ env.VERSION }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max