Skip to content

Commit

Permalink
add publish CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bschimke95 committed Jul 2, 2024
1 parent 22de4fd commit c81a082
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/publish-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish Images

on:
push:
branches:
- main
- 'release-[0-9]+.[0-9]+'
# TODO: remove before merge
pull_request:

permissions:
contents: read

jobs:
test:
permissions:
contents: read # for actions/checkout to fetch code
name: Unit Tests & Code Quality
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Determine branch
id: determine
env:
BRANCH: ${{ github.ref }}
run: |
BRANCH=${BRANCH#refs/heads/} # strip off refs/heads/ if it exists
if [[ "${BRANCH}" == "main" ]]; then
echo "version=latest" >> "$GITHUB_OUTPUT"
elif [[ "${BRANCH}" =~ ^release-[0-9]+\.[0-9]+$ ]]; then
echo "version=v${BRANCH#release-}" >> "$GITHUB_OUTPUT"
else
# TODO: Remove before merge, only for testing
echo "Use Branch ${BRANCH} only for testing."
echo "version=latest" >> "$GITHUB_OUTPUT"
exit 1
fi
- name: Check out code
uses: actions/checkout@v4

- name: Build bootstrap provider image
run: BOOTSTRAP_IMAGE_TAG=${{ steps.determine.outputs.version }} docker-build-bootstrap

- name: Build controlplane provider image
run: CONTROLPLANE_IMAGE_TAG=${{ steps.determine.outputs.version }} docker-build-bootstrap

- name: Publish bootstrap provider image
run: BOOTSTRAP_IMAGE_TAG=${{ steps.determine.outputs.version }} docker-publish-bootstrap

- name: Publish controlplane provider image
run: CONTROLPLANE_IMAGE_TAG=${{ steps.determine.outputs.version }} docker-publish-controlplane

0 comments on commit c81a082

Please sign in to comment.