-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1013 from terrestris/next
merge next to main
- Loading branch information
Showing
9 changed files
with
229 additions
and
68 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
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,90 @@ | ||
name: Release Docker | ||
|
||
on: | ||
workflow_call: # allows being called by other workflows | ||
inputs: | ||
release_is_published: | ||
required: true | ||
type: string | ||
release_version: | ||
required: true | ||
type: string | ||
secrets: | ||
nexus_user: | ||
required: true | ||
nexus_pass: | ||
required: true | ||
|
||
env: | ||
DOCKER_REGISTRY: docker-public.terrestris.de/terrestris | ||
|
||
jobs: | ||
release-docker: | ||
name: Release Docker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources 🔰 | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: v${{ inputs.release_version }} | ||
|
||
- name: Login to Nexus | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.DOCKER_REGISTRY }} | ||
username: ${{ secrets.nexus_user }} | ||
password: ${{ secrets.nexus_pass }} | ||
|
||
- name: Build docker image (latest) | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
tags: | | ||
${{ env.DOCKER_REGISTRY }}/shogun-admin:latest | ||
load: true | ||
|
||
- name: Build docker image (version) | ||
if: ${{ inputs.release_is_published }} == 'true' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
tags: | | ||
${{ env.DOCKER_REGISTRY }}/shogun-admin:${{ inputs.release_version }} | ||
load: true | ||
|
||
- name: Push docker image to Nexus (latest) | ||
run: | | ||
docker push ${{ env.DOCKER_REGISTRY }}/shogun-admin:latest | ||
- name: Push docker image to Nexus (version) | ||
if: ${{ inputs.release_is_published }} == 'true' | ||
run: | | ||
docker push ${{ env.DOCKER_REGISTRY }}/shogun-admin:${{ inputs.release_version }} | ||
- name: Build docker image e2e-tests (latest) 🏗️ | ||
uses: docker/build-push-action@v6 | ||
with: | ||
file: Dockerfile.e2e | ||
context: . | ||
tags: | | ||
${{ env.DOCKER_REGISTRY }}/shogun-admin-client-e2e-tests:latest | ||
load: true | ||
|
||
- name: Build docker image e2e-tests (version) 🏗️ | ||
if: ${{ inputs.release_is_published }} == 'true' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
file: Dockerfile.e2e | ||
context: . | ||
tags: | | ||
${{ env.DOCKER_REGISTRY }}/shogun-admin-client-e2e-tests:${{ inputs.release_version }} | ||
load: true | ||
|
||
- name: Push docker image to Nexus e2e-tests (latest) 📠 | ||
run: | | ||
docker push ${{ env.DOCKER_REGISTRY }}/shogun-admin-client-e2e-tests:latest | ||
- name: Push docker image to Nexus e2e-tests (version) 📠 | ||
if: ${{ inputs.release_is_published }} == 'true' | ||
run: | | ||
docker push ${{ env.DOCKER_REGISTRY }}/shogun-admin-client-e2e-tests:${{ inputs.release_version }} |
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,46 @@ | ||
name: Update docker base images | ||
|
||
on: | ||
workflow_dispatch: # allow manual trigger | ||
schedule: | ||
- cron: '0 3 * * 0' # every sunday at 03:00 UTC | ||
|
||
jobs: | ||
latest-tags: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
main_tag: ${{ steps.main_tag.outputs.result }} | ||
next_tag: ${{ steps.next_tag.outputs.result }} | ||
steps: | ||
- name: Checkout sources 🔰 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # tags only | ||
|
||
- name: Get latest main tag | ||
id: main_tag | ||
run: echo "result=$(git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n1 | sed 's/^v//')" >> $GITHUB_ENV | ||
|
||
- name: Get latest next tag | ||
id: next_tag | ||
run: echo "result=$(git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-next\.[0-9]+)?$' | sort -V | tail -n1 | sed 's/^v//')" >> $GITHUB_ENV | ||
|
||
update-docker-main: | ||
needs: latest-tags | ||
uses: ./.github/workflows/release_docker.yml | ||
with: | ||
release_is_published: true | ||
release_version: ${{ needs.latest-tags.outputs.main_tag }} | ||
secrets: | ||
nexus_user: ${{ secrets.NEXUS_USERNAME}} | ||
nexus_pass: ${{ secrets.NEXUS_PASSWORD}} | ||
|
||
update-docker-next: | ||
needs: latest-tags | ||
uses: ./.github/workflows/release_docker.yml | ||
with: | ||
release_is_published: true | ||
release_version: ${{ needs.latest-tags.outputs.next_tag }} | ||
secrets: | ||
nexus_user: ${{ secrets.NEXUS_USERNAME}} | ||
nexus_pass: ${{ secrets.NEXUS_PASSWORD}} |
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
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
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
FROM node:23.3.0-alpine3.19 | ||
|
||
RUN apk update && apk upgrade --no-cache | ||
|
||
WORKDIR /app | ||
|
||
EXPOSE 8080 | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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