Skip to content

use separate files for registry secret creation #281

use separate files for registry secret creation

use separate files for registry secret creation #281

Workflow file for this run

name: Docker
on:
push:
# Publish `master` as Docker `latest` image.
#branches:
# - main
# Publish `v1.2.3` tags as releases.
tags:
- v*
workflow_dispatch:
# Run tests for any PRs.
#pull_request:
env:
SDK_VERSION: "v1.29.0"
jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Install operator-sdk"
run : |
curl -L -o /usr/local/bin/operator-sdk "https://github.com/operator-framework/operator-sdk/releases/download/${SDK_VERSION}/operator-sdk_linux_amd64"
chmod +x /usr/local/bin/operator-sdk
- name: "Get Version"
id: get_version
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
#[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "main" ] && VERSION=latest
echo "IMG=ghcr.io/kubero-dev/kubero-operator/kuberoapp:${VERSION}" >> $GITHUB_ENV
echo "BUNDLE_IMG=ghcr.io/kubero-dev/kubero-operator/kuberoapp-bundle:${VERSION}" >> $GITHUB_ENV
echo ::set-output name=VERSION::$(cat VERSION)
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,amd64'
# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build images
run: |
make docker-build
make bundle-build
# - name: Push image ghcr.io
# run: |
# make docker-push
# make bundle-push