Skip to content

Docker build wireproxy with debian based image #7518

Docker build wireproxy with debian based image

Docker build wireproxy with debian based image #7518

name: Docker build wireproxy with debian based image
on:
workflow_dispatch:
schedule:
- cron: "0 * * * *"
push:
paths:
- '.github/workflows/docker-build-wireproxy-debian.yml'
- 'wireproxy-debian/**'
jobs:
build:
runs-on: 'ubuntu-latest'
steps:
- name: Get latest commit hash
id: get-latest-commit
run: |
echo "commit=$(git ls-remote https://github.com/pufferffish/wireproxy.git | head -n1 | awk '{print $1;}')" >> $GITHUB_ENV
shell: bash
- uses: actions/cache@v2
id: cache
with:
path: wireproxy-debian
key: ${{ runner.os }}-v3-${{ env.commit }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
platforms: all
- name: Check Out Repo
uses: actions/checkout@v3
- name: Login to Quay.io
if: steps.cache.outputs.cache-hit != 'true'
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Set up Docker Buildx
if: steps.cache.outputs.cache-hit != 'true'
id: buildx
uses: docker/setup-buildx-action@v2
with:
version: latest
- name: Set up build timestamp
if: steps.cache.outputs.cache-hit != 'true'
run: echo "timestamp=$(date +%Y%m%d)" >> $GITHUB_ENV
- name: Build and push docker image
if: steps.cache.outputs.cache-hit != 'true'
id: docker_build_new
uses: docker/build-push-action@v3
with:
context: ./wireproxy-debian
file: ./wireproxy-debian/Dockerfile
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
push: true
tags: quay.io/unixfox/wireproxy-debian:latest, quay.io/unixfox/wireproxy-debian:build-${{ env.timestamp }}