Skip to content

Real ip extractor

Real ip extractor #22

Workflow file for this run

name: release
permissions:
contents: write
packages: write
on:
push:
branches: [master]
jobs:
build_and_push:
runs-on: ubuntu-latest
env:
REPOSITORY: ${{ github.repository }}
steps:
- uses: actions/checkout@v4
# Build and push with docker buildx
- name: Setup docker buildx
uses: docker/setup-buildx-action@v2
- name: Configure tags based on git tags + latest
uses: docker/metadata-action@v4
id: meta
with:
images: ${{ env.REPOSITORY }}
tags: |
type=pep440,pattern={{version}}
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=pr
- name: Docker login on main origin
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: musl-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Compile
run: |
mkdir -p ~/.cargo/{git,registry}
docker run --rm -t \
--mount type=bind,source=${{ github.workspace }},target=/volume \
--mount type=bind,source=$HOME/.cargo/registry,target=/root/.cargo/registry \
--mount type=bind,source=$HOME/.cargo/git,target=/root/.cargo/git \
clux/muslrust:stable \
cargo build --release --bin waf-bouncer
cp target/x86_64-unknown-linux-musl/release/waf-bouncer .
- name: Docker buildx and push with base features
uses: docker/build-push-action@v4
with:
context: .
cache-from: type=gha,scope=base
cache-to: type=gha,scope=base,mode=max
push: ${{ github.ref == 'refs/heads/master' }}
tags: ghcr.io/${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
build-args: REPOSITORY=${{ env.REPOSITORY }}