You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.7 KiB
71 lines
2.7 KiB
3 years ago
|
name: "Release docker images from release"
|
||
|
|
||
|
on:
|
||
|
workflow_dispatch:
|
||
|
inputs:
|
||
|
realease_tag:
|
||
|
description: 'The release tag to build containers for (preview or x.y.z)'
|
||
|
required: true
|
||
|
|
||
|
|
||
|
jobs:
|
||
|
build_docker_image:
|
||
|
name: Build docker images
|
||
|
runs-on: ubuntu-latest
|
||
|
env:
|
||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||
|
steps:
|
||
|
- name: Checkout tagged commit
|
||
|
uses: actions/checkout@v2.4.0
|
||
|
# TODO: checkout the tag and not master
|
||
|
- name: Set up QEMU
|
||
|
uses: docker/setup-qemu-action@v1
|
||
|
|
||
|
- name: Set up docker buildx
|
||
|
uses: docker/setup-buildx-action@v1
|
||
|
|
||
|
- name: Login into github registry
|
||
|
uses: docker/login-action@v1.10.0
|
||
|
with:
|
||
|
registry: ghcr.io
|
||
|
username: ${{ github.repository }}
|
||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||
|
|
||
|
- name: Build and publish docker images
|
||
|
run: |
|
||
|
gh release download ${{ github.event.inputs.realease_tag }} -p '*Linux_x86_64*' -p '*aarch64*' -p '*armv7*'
|
||
|
|
||
|
# We need to extract into sub folders to so that our dockerimage can fine the binaries.
|
||
|
#
|
||
|
# By providing `platform` to `docker buildx` the variable `TARGETPLATFORM` will be available
|
||
|
# when building the image. This variable is either
|
||
|
# `linux/amd64/`, `linux/arm64/` or `linux/arm/v7`. Hence we need to extract into subfolders.
|
||
|
|
||
|
7z x maker_${{ github.event.inputs.realease_tag }}_Linux_aarch64.tar -olinux/arm64/
|
||
|
7z x taker_${{ github.event.inputs.realease_tag }}_Linux_aarch64.tar -olinux/arm64/
|
||
|
|
||
|
7z x maker_${{ github.event.inputs.realease_tag }}_Linux_x86_64.tar -olinux/amd64/
|
||
|
7z x taker_${{ github.event.inputs.realease_tag }}_Linux_x86_64.tar -olinux/amd64/
|
||
|
|
||
|
7z x maker_${{ github.event.inputs.realease_tag }}_Linux_armv7.tar -olinux/arm/v7
|
||
|
7z x taker_${{ github.event.inputs.realease_tag }}_Linux_armv7.tar -olinux/arm/v7
|
||
|
|
||
|
docker buildx build \
|
||
|
--push \
|
||
|
--platform linux/amd64,linux/arm64,linux/arm/v7 \
|
||
|
--label "org.opencontainers.image.source https://github.com/${{ github.repository }}" \
|
||
|
--tag ghcr.io/${{ github.repository }}/maker:${{ github.event.inputs.realease_tag }} \
|
||
|
--build-arg BINARY_PATH=maker \
|
||
|
.
|
||
|
|
||
|
docker buildx build \
|
||
|
--push \
|
||
|
--platform linux/amd64,linux/arm64,linux/arm/v7 \
|
||
|
--label "org.opencontainers.image.source https://github.com/${{ github.repository }}" \
|
||
|
--tag ghcr.io/${{ github.repository }}/taker:${{ github.event.inputs.realease_tag }} \
|
||
|
--build-arg BINARY_PATH=taker \
|
||
|
.
|
||
|
|
||
|
|
||
|
|