Pushing malfeasance-fetcher to Dockerhub #2769
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate latest build and push it to dockerhub on push to develop branch. | |
# NOTE: This workflow does not include any tests, nor any dependencies, since bors guarantees | |
# that only code that passes all tests is ever pushed to develop. | |
name: Push to Dockerhub | |
run-name: Pushing ${{ github.ref_name }} to Dockerhub | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
on: | |
push: | |
branches: | |
- develop | |
tags: | |
- '*' | |
workflow_dispatch: | |
inputs: | |
custom_image_tag: | |
description: 'A custom image tag' | |
default: '' | |
jobs: | |
dockerpush-images: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
outname_sufix: "linux-amd64" | |
- os: ubuntu-latest-arm-8-cores | |
outname_sufix: "linux-arm64" | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.GH_ACTION_PRIVATE_KEY }} | |
- uses: extractions/netrc@v2 | |
with: | |
machine: github.com | |
username: ${{ secrets.GH_ACTION_TOKEN_USER }} | |
password: ${{ secrets.GH_ACTION_TOKEN }} | |
if: vars.GOPRIVATE | |
- name: get tag sufix arm64 | |
if: ${{ runner.arch == 'arm64' }} | |
run: | | |
echo "SUFIX=-arm64" >> $GITHUB_ENV | |
- name: get tag sufix amd64 | |
if: ${{ runner.arch != 'arm64' }} | |
run: | | |
echo "SUFIX=-amd64" >> $GITHUB_ENV | |
- name: Build docker images | |
run: | | |
export VERSION="${{ github.ref_name }}" TAG_SUFIX=$SUFIX | |
make dockerbuild-go | |
make dockerbuild-bs | |
- name: Push docker images to dockerhub | |
run: | | |
export TAG_SUFIX=$SUFIX | |
make dockerpush-only | |
make dockerpush-bs-only | |
- name: Push docker images to dockerhub | |
if: inputs.custom_image_tag | |
run: | | |
export DOCKER_IMAGE_VERSION="${{ inputs.custom_image_tag }}" TAG_SUFIX=$SUFIX | |
make dockerpush-only | |
make dockerpush-bs-only | |
- name: Push docker images with version tag to dockerhub | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
export DOCKER_IMAGE_VERSION="${{ github.ref_name }}" TAG_SUFIX=$SUFIX | |
make dockerpush-only | |
make dockerpush-bs-only | |
export DOCKER_IMAGE_REPO="go-spacemesh" | |
make dockerpush-only | |
make dockerpush-bs-only | |
dockerpush-manifest: | |
needs: [dockerpush-images] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.GH_ACTION_PRIVATE_KEY }} | |
- uses: extractions/netrc@v2 | |
with: | |
machine: github.com | |
username: ${{ secrets.GH_ACTION_TOKEN_USER }} | |
password: ${{ secrets.GH_ACTION_TOKEN }} | |
if: vars.GOPRIVATE | |
- name: Push docker manifest to dockerhub | |
run: | | |
make dockerpush-go-manifest | |
make dockerpush-bs-manifest | |
- name: Push docker manifest to dockerhub | |
if: inputs.custom_image_tag | |
run: | | |
export DOCKER_IMAGE_VERSION="${{ inputs.custom_image_tag }}" | |
make dockerpush-go-manifest | |
make dockerpush-bs-manifest | |
- name: Push docker manifest with version tag to dockerhub | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
export DOCKER_IMAGE_VERSION="${{ github.ref_name }}" | |
make dockerpush-go-manifest | |
make dockerpush-bs-manifest | |
export DOCKER_IMAGE_REPO="go-spacemesh" | |
make dockerpush-go-manifest | |
make dockerpush-bs-manifest |