File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Docker build on tag
2+ env :
3+ DOCKER_CLI_EXPERIMENTAL : enabled
4+ TAG_FMT : " ^refs/tags/(((.?[0-9]+){3,4}))$"
5+ on :
6+ push :
7+ tags :
8+ - v[0-9]+.[0-9]+.[0-9]+
9+ - v[0-9]+.[0-9]+.[0-9]+-*
10+ jobs :
11+ build :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Set env variables
15+ run : echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
16+ - uses : actions/checkout@v2
17+ - uses : actions/cache@v2
18+ with :
19+ path : /tmp/.buildx-cache
20+ key : ${{ runner.os }}-buildx-${{ github.sha }}
21+ restore-keys : |
22+ ${{ runner.os }}-buildx-
23+ - uses : docker/login-action@v1
24+ with :
25+ registry : ghcr.io
26+ username : ${{ github.repository_owner }}
27+ password : ${{ secrets.GITHUB_TOKEN }}
28+ - uses : docker/setup-qemu-action@v1
29+ - uses : docker/setup-buildx-action@v1
30+ - name : Build the Docker image
31+ run : |
32+ docker buildx build \
33+ -t ghcr.io/${{ github.repository_owner }}/snort:$TAG \
34+ --cache-from "type=local,src=/tmp/.buildx-cache" \
35+ --cache-to "type=local,dest=/tmp/.buildx-cache" \
36+ --platform linux/amd64,linux/arm64 \
37+ --push .
You can’t perform that action at this time.
0 commit comments