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
|
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:
|
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:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2021-06-17 16:37:47 +00:00
|
|
|
|
2021-06-17 07:35:10 +00:00
|
|
|
- name: Set up QEMU
|
2022-10-11 23:30:53 +00:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2021-06-17 16:37:47 +00:00
|
|
|
|
2021-06-17 07:35:10 +00:00
|
|
|
- name: Set up Docker Buildx
|
2022-10-11 23:30:53 +00:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2021-06-17 16:37:47 +00:00
|
|
|
|
2021-06-17 07:35:10 +00:00
|
|
|
- name: Login to DockerHub
|
2022-10-11 23:30:53 +00:00
|
|
|
uses: docker/login-action@v2
|
2021-06-17 17:07:10 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Login to GitHub Container registry
|
2022-10-11 23:30:53 +00:00
|
|
|
uses: docker/login-action@v2
|
2021-06-17 07:35:10 +00:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
2021-06-17 16:37:47 +00:00
|
|
|
username: ${{ github.actor }}
|
2021-06-17 07:35:10 +00:00
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2021-06-17 16:37:47 +00:00
|
|
|
|
2022-10-04 09:58:43 +00:00
|
|
|
- name: Build container for ${{ matrix.archname }}
|
|
|
|
uses: docker/build-push-action@v3
|
2021-06-17 07:35:10 +00:00
|
|
|
with:
|
2021-06-17 16:37:47 +00:00
|
|
|
context: ./contrib/docker
|
|
|
|
file: ./contrib/docker/Dockerfile
|
2022-10-04 09:58:43 +00:00
|
|
|
platforms: ${{ matrix.platform }}
|
2021-06-17 07:35:10 +00:00
|
|
|
push: true
|
2021-06-17 17:07:10 +00:00
|
|
|
tags: |
|
2022-10-04 09:58:43 +00:00
|
|
|
purplei2p/i2pd:latest-${{ matrix.archname }}
|
|
|
|
ghcr.io/purplei2p/i2pd:latest-${{ matrix.archname }}
|
|
|
|
|
|
|
|
push:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
needs: build
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
2022-10-11 23:30:53 +00:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2022-10-04 09:58:43 +00:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
2022-10-11 23:30:53 +00:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2022-10-04 09:58:43 +00:00
|
|
|
|
|
|
|
- name: Login to DockerHub
|
2022-10-11 23:30:53 +00:00
|
|
|
uses: docker/login-action@v2
|
2022-10-04 09:58:43 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Login to GitHub Container registry
|
2022-10-11 23:30:53 +00:00
|
|
|
uses: docker/login-action@v2
|
2022-10-04 09:58:43 +00:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Create and push latest manifest image to Docker Hub
|
|
|
|
uses: Noelware/docker-manifest-action@master
|
|
|
|
with:
|
|
|
|
base-image: purplei2p/i2pd:latest
|
|
|
|
extra-images: purplei2p/i2pd:latest-amd64,purplei2p/i2pd:latest-i386,purplei2p/i2pd:latest-arm64,purplei2p/i2pd:latest-armv7
|
|
|
|
push: true
|
2021-06-17 18:37:48 +00:00
|
|
|
|
2022-10-04 09:58:43 +00:00
|
|
|
- name: Create and push latest manifest image to GHCR
|
|
|
|
uses: Noelware/docker-manifest-action@master
|
|
|
|
with:
|
|
|
|
base-image: ghcr.io/purplei2p/i2pd:latest
|
|
|
|
extra-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
|
2021-06-17 18:37:48 +00:00
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
|
|
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
|
|
|
|
|
2022-10-04 09:58:43 +00:00
|
|
|
- name: Create and push release manifest image to Docker Hub
|
2021-06-17 18:37:48 +00:00
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
2022-10-04 09:58:43 +00:00
|
|
|
uses: Noelware/docker-manifest-action@master
|
2021-06-17 18:37:48 +00:00
|
|
|
with:
|
2022-10-04 09:58:43 +00:00
|
|
|
base-image: purplei2p/i2pd:latest-release
|
|
|
|
extra-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 image to GHCR
|
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
|
|
uses: Noelware/docker-manifest-action@master
|
|
|
|
with:
|
|
|
|
base-image: ghcr.io/purplei2p/i2pd:latest-release
|
|
|
|
extra-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: Create and push versioned manifest image to Docker Hub
|
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
|
|
uses: Noelware/docker-manifest-action@master
|
|
|
|
with:
|
|
|
|
base-image: purplei2p/i2pd:release-${{ env.RELEASE_VERSION }}
|
|
|
|
extra-images: purplei2p/i2pd:latest-amd64,purplei2p/i2pd:latest-i386,purplei2p/i2pd:latest-arm64,purplei2p/i2pd:latest-armv7
|
|
|
|
push: true
|
|
|
|
|
|
|
|
- name: Create and push versioned manifest image to GHCR
|
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
|
|
uses: Noelware/docker-manifest-action@master
|
|
|
|
with:
|
|
|
|
base-image: ghcr.io/purplei2p/i2pd:release-${{ env.RELEASE_VERSION }}
|
|
|
|
extra-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
|
2021-06-17 18:37:48 +00:00
|
|
|
push: true
|