Skip to content

let user control flyway image through api #134

let user control flyway image through api

let user control flyway image through api #134

Workflow file for this run

name: build
on:
pull_request:
branches:
- "*"
push:
branches:
- main
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
permissions:
checks: write
contents: write
packages: write
statuses: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: createVersion
run: |
echo "GIT_VERSION=$(git describe --tag --always)" >> $GITHUB_ENV
echo "VERSION=$(git describe --tag --always | sed s/^v//)" >> $GITHUB_ENV
- name: setup go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: run tests
run: |
make test
- uses: codecov/codecov-action@v3
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build and push
run: |
make docker-buildx VERSION=${{ env.VERSION }}
- name: bundle
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: |
make bundle bundle-build bundle-push VERSION=${{ env.VERSION }}
- name: catalog
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: |
export CATALOG_BASE_IMG=ghcr.io/davidkarlsen/flyway-operator-catalog:alpha
make catalog-build catalog-push VERSION=${{ env.VERSION }} CATALOG_BASE_IMG=${CATALOG_BASE_IMG}
# re-tag as alpha, so that we can stick to a single channel
echo re-tagging
docker tag ghcr.io/davidkarlsen/flyway-operator-catalog:${{ env.GIT_VERSION }} ${CATALOG_BASE_IMG}
docker push ${CATALOG_BASE_IMG}
- name: createRelease
if: startsWith(github.ref, 'refs/tags/v')
uses: marvinpinto/action-automatic-releases@v1.2.1
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false