Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend CI to test operator storing on ghcr.io #588

Merged
merged 1 commit into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,23 @@ jobs:
strategy: ${{ fromJson(needs.generate-jobs.outputs.strategy) }}
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
DEPLOY_IMAGES: false
steps:
- uses: actions/checkout@v3
- name: Check for registry credentials
if: github.repository == 'MariaDB/mariadb-docker' && github.ref == 'refs/heads/master'
run: |
missing=()
[[ -n "${{ secrets.MARIADB_OPERATOR_TOKEN }}" ]] || missing+=(MARIADB_OPERATOR_TOKEN)
for i in "${missing[@]}"; do
echo "Missing github secret: $i"
done
if (( ${#missing[@]} == 0 )); then
echo "DEPLOY_IMAGES=true" >> $GITHUB_ENV
else
echo "Not pushing images to registry or doing operator test"
fi
- name: Prepare Environment
run: ${{ matrix.runs.prepare }}
- name: Pull Dependencies
Expand All @@ -74,3 +89,24 @@ jobs:
run: ${{ matrix.runs.mariadbtest }}
- name: '"docker images"'
run: ${{ matrix.runs.images }}
- name: login to registry
if: ${{ env.DEPLOY_IMAGES == 'true' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: tag
if: ${{ env.DEPLOY_IMAGES == 'true' }}
run: docker tag ${{ matrix.name }} ghcr.io/MariaDB/mariadb:${{ matrix.name }}
- name: push
if: ${{ env.DEPLOY_IMAGES == 'true' }}
uses: docker/build-push-action@v5
with:
push: true
tags: ghcr.io/MariaDB/mariadb:${{ matrix.name }}
- name: MariaDB Operator Test
if: ${{ env.DEPLOY_IMAGES == 'true' }}
run: gh workflow run test-image.yaml --repo mariadb-operator/mariadb-operator -f mariadb_image=ghcr.io/MariaDB/mariadb:${{ matrix.name }}
env:
GITHUB_TOKEN: "${{ secrets.MARIADB_OPERATOR_TOKEN }}"
Loading