2021-06-17 16:37:47 +00:00
|
|
|
name: Build containers
|
2021-06-17 07:35:10 +00:00
|
|
|
|
2022-05-20 18:11:19 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- openssl
|
2022-10-04 09:58:43 +00:00
|
|
|
- docker
|
2023-12-18 09:55:10 +00:00
|
|
|
paths:
|
|
|
|
- .github/workflows/docker.yml
|
|
|
|
- contrib/docker/**
|
|
|
|
- contrib/certificates/**
|
|
|
|
- daemon/**
|
|
|
|
- i18n/**
|
|
|
|
- libi2pd/**
|
|
|
|
- libi2pd_client/**
|
|
|
|
- Makefile
|
|
|
|
- Makefile.linux
|
2022-05-20 18:25:36 +00:00
|
|
|
tags:
|
2022-05-20 18:30:14 +00:00
|
|
|
- '*'
|
2021-06-17 07:35:10 +00:00
|
|
|
|
|
|
|
jobs:
|
2022-10-04 09:58:43 +00:00
|
|
|
build:
|
2023-02-26 20:38:23 +00:00
|
|
|
name: Building container for ${{ matrix.platform }}
|
2021-06-17 07:35:10 +00:00
|
|
|
runs-on: ubuntu-latest
|
2021-06-17 16:37:47 +00:00
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
contents: read
|
|
|
|
|
2022-10-04 09:58:43 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include: [
|
|
|
|
{ platform: 'linux/amd64', archname: 'amd64' },
|
|
|
|
{ platform: 'linux/386', archname: 'i386' },
|
|
|
|
{ platform: 'linux/arm64', archname: 'arm64' },
|
|
|
|
{ platform: 'linux/arm/v7', archname: 'armv7' },
|
|
|
|
]
|
|
|
|
|
2021-06-17 07:35:10 +00:00
|
|
|
steps:
|
2023-02-26 20:38:23 +00:00
|
|
|
- name: Checkout
|
2024-04-27 13:49:48 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-02-26 20:38:23 +00:00
|
|
|
|
|
|
|
- name: Set up QEMU
|
2024-04-27 13:49:48 +00:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2023-02-26 20:38:23 +00:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
2024-04-27 13:49:48 +00:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-02-26 20:38:23 +00:00
|
|
|
|
|
|
|
- name: Login to DockerHub
|
2024-04-27 13:49:48 +00:00
|
|
|
uses: docker/login-action@v3
|
2023-02-26 20:38:23 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Login to GitHub Container registry
|
2024-04-27 13:49:48 +00:00
|
|
|
uses: docker/login-action@v3
|
2023-02-26 20:38:23 +00:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Build container for ${{ matrix.archname }}
|
2024-04-27 13:49:48 +00:00
|
|
|
uses: docker/build-push-action@v5
|
2023-02-26 20:38:23 +00:00
|
|
|
with:
|
|
|
|
context: ./contrib/docker
|
|
|
|
file: ./contrib/docker/Dockerfile
|
|
|
|
platforms: ${{ matrix.platform }}
|
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
purplei2p/i2pd:latest-${{ matrix.archname }}
|
|
|
|
ghcr.io/purplei2p/i2pd:latest-${{ matrix.archname }}
|
|
|
|
provenance: false
|
2022-10-04 09:58:43 +00:00
|
|
|
|
|
|
|
push:
|
2023-02-26 20:38:23 +00:00
|
|
|
name: Pushing merged manifest
|
2022-10-04 09:58:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-02-26 20:38:23 +00:00
|
|
|
|
2022-10-04 09:58:43 +00:00
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
needs: build
|
|
|
|
|
|
|
|
steps:
|
2023-02-26 20:38:23 +00:00
|
|
|
- name: Checkout
|
2024-04-27 13:49:48 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-02-26 20:38:23 +00:00
|
|
|
|
|
|
|
- name: Set up QEMU
|
2024-04-27 13:49:48 +00:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2023-02-26 20:38:23 +00:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
2024-04-27 13:49:48 +00:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-02-26 20:38:23 +00:00
|
|
|
|
|
|
|
- name: Login to DockerHub
|
2024-04-27 13:49:48 +00:00
|
|
|
uses: docker/login-action@v3
|
2023-02-26 20:38:23 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Login to GitHub Container registry
|
2024-04-27 13:49:48 +00:00
|
|
|
uses: docker/login-action@v3
|
2023-02-26 20:38:23 +00:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Create and push latest manifest image to Docker Hub
|
|
|
|
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
|
|
uses: Noelware/docker-manifest-action@master
|
|
|
|
with:
|
|
|
|
inputs: purplei2p/i2pd:latest
|
|
|
|
images: purplei2p/i2pd:latest-amd64,purplei2p/i2pd:latest-i386,purplei2p/i2pd:latest-arm64,purplei2p/i2pd:latest-armv7
|
|
|
|
push: true
|
|
|
|
|
|
|
|
- name: Create and push latest manifest image to GHCR
|
|
|
|
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
|
|
uses: Noelware/docker-manifest-action@master
|
|
|
|
with:
|
|
|
|
inputs: ghcr.io/purplei2p/i2pd:latest
|
|
|
|
images: ghcr.io/purplei2p/i2pd:latest-amd64,ghcr.io/purplei2p/i2pd:latest-i386,ghcr.io/purplei2p/i2pd:latest-arm64,ghcr.io/purplei2p/i2pd:latest-armv7
|
|
|
|
push: true
|
|
|
|
|
|
|
|
- name: Store release version to env
|
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
|
|
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Create and push release manifest to Docker Hub
|
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
|
|
uses: Noelware/docker-manifest-action@master
|
|
|
|
with:
|
|
|
|
inputs: purplei2p/i2pd:latest,purplei2p/i2pd:latest-release,purplei2p/i2pd:release-${{ env.RELEASE_VERSION }}
|
|
|
|
images: purplei2p/i2pd:latest-amd64,purplei2p/i2pd:latest-i386,purplei2p/i2pd:latest-arm64,purplei2p/i2pd:latest-armv7
|
|
|
|
push: true
|
|
|
|
|
|
|
|
- name: Create and push release manifest to GHCR
|
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
|
|
uses: Noelware/docker-manifest-action@master
|
|
|
|
with:
|
|
|
|
inputs: ghcr.io/purplei2p/i2pd:latest,ghcr.io/purplei2p/i2pd:latest-release,ghcr.io/purplei2p/i2pd:release-${{ env.RELEASE_VERSION }}
|
|
|
|
images: ghcr.io/purplei2p/i2pd:latest-amd64,ghcr.io/purplei2p/i2pd:latest-i386,ghcr.io/purplei2p/i2pd:latest-arm64,ghcr.io/purplei2p/i2pd:latest-armv7
|
|
|
|
push: true
|