Skip to content

Build_i2pd

Build_i2pd #339

Workflow file for this run

name: Build_i2pd
on:
workflow_dispatch:
schedule:
- cron: "0 0 5 * *"
#push:
#branches: [ master ]
# Publish semver tags as releases.
#tags: [ 'v*.*.*' ]
#pull_request:
#branches: [ master ]
env:
#REGISTRY: ghcr.io
REGISTRY: docker.io
NAME: i2pd
ARCH: linux/amd64, linux/arm64/v8, linux/arm/v6, linux/arm/v7, linux/386, linux/ppc64le, linux/s390x
DESCRIPTION: Multiarch i2pd.
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DH_USERNAME }}
password: ${{ secrets.DH_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ secrets.DH_USERNAME }}/${{ env.NAME }}
tags: |
type=raw, value=latest
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: ${{ env.NAME }}
push: ${{ github.event_name != 'pull_request' }}
platforms: ${{ env.ARCH }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
allow: security.insecure
cache-from: type=gha
cache-to: type=gha
- name: Available platforms
run: echo ${{ steps.build-and-push.outputs.platforms }}
- name: push README to Dockerhub
uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_USER: ${{ secrets.DH_USERNAME }}
DOCKER_PASS: ${{ secrets.DH_PASSWORD }}
with:
destination_container_repo: ${{ secrets.DH_USERNAME }}/${{ env.NAME }}
provider: dockerhub
short_description: ${{ env.DESCRIPTION }}
readme_file: "${{ env.NAME }}/README.md"