diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..6124692 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,10 @@ +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + pull-request-branch-name: + # Separate sections of the branch name with a hyphen + separator: "-" diff --git a/.github/workflows/ci-docker.yaml b/.github/workflows/ci-docker.yaml new file mode 100644 index 0000000..f6ca26b --- /dev/null +++ b/.github/workflows/ci-docker.yaml @@ -0,0 +1,38 @@ +name: ci +on: + release: + types: [published] +jobs: + docker-build-and-push: + runs-on: ubuntu-latest + steps: + - + name: "Checkout repository" + uses: actions/checkout@v2 + - + name: "Set up Docker Buildx" + uses: docker/setup-buildx-action@v1 + - + 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: "Login to Container Registry" + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: "Build and push docker image" + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ${{ github.repository }}:${{ github.event.release.tag_name }} + build-args: RELEASE_VERSION=${{ github.event.release.tag_name }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,mode=max,dest=/tmp/.buildx-cache diff --git a/Dockerfile b/Dockerfile index 1f9336d..8317b9f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ -FROM alpine:latest as builder +FROM alpine:3.12 as builder + +ARG RELEASE_VERSION + RUN apk add --no-cache ca-certificates openssl -RUN wget https://github.com/buger/goreplay/releases/download/v1.2.0/gor_v1.2.0_x64.tar.gz -O gor.tar.gz +RUN wget https://github.com/buger/goreplay/releases/download/${RELEASE_VERSION}/gor_${RELEASE_VERSION}_x64.tar.gz -O gor.tar.gz RUN tar xzf gor.tar.gz FROM scratch