-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22de4fd
commit c81a082
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
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
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 |