-
Notifications
You must be signed in to change notification settings - Fork 0
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 #67 from SmartCityFlensburg/release/v1.0.0
Release version v1.0.0
- Loading branch information
Showing
120 changed files
with
3,285 additions
and
749 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
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,9 @@ | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} |
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,30 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# Top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.css] | ||
indent_size = 4 | ||
|
||
[*.scss] | ||
indent_size = 4 | ||
|
||
[*.js] | ||
indent_size = 4 | ||
|
||
[*.json] | ||
indent_size = 2 | ||
|
||
[*.yaml] | ||
indent_size = 2 | ||
|
||
[*.yml] | ||
indent_size = 2 |
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 |
---|---|---|
|
@@ -8,13 +8,17 @@ jobs: | |
build_and_deploy_dev: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
contents: write | ||
packages: write | ||
actions: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set commit sha | ||
run: | | ||
echo "COMMIT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
|
@@ -41,4 +45,32 @@ jobs: | |
file: ./.docker/Dockerfile.dev | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ghcr.io/${{ env.REPO_LC }}-dev:latest | ||
tags: ghcr.io/${{ env.REPO_LC }}-dev:latest, ghcr.io/${{ env.REPO_LC }}-dev:${{ env.COMMIT_SHA }} | ||
|
||
- name: "Setup yq" | ||
uses: dcarbone/[email protected] | ||
with: | ||
version: "v4.42.1" | ||
force: true | ||
|
||
- name: Initialize mandatory git config | ||
run: | | ||
git config --global user.name 'GitHub Actions' | ||
git config --global user.email '[email protected]' | ||
- name: Bump version in values/develop.yaml | ||
run: yq -i '.deployment.image.tag=strenv(COMMIT_SHA)' ./k8s/values/develop.yaml | ||
|
||
- name: Commit k8s values files | ||
id: make-commit | ||
run: | | ||
git add ./k8s/values/develop.yaml | ||
git commit --message "Update dev image to commit ${{ env.COMMIT_SHA }}" | ||
echo "::set-output name=commit::$(git rev-parse HEAD)" | ||
- name: Push changes | ||
uses: CasperWA/push-protected@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: develop |
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,6 @@ | ||
name: Build and Push Docker Image Staging | ||
"on": | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- release/* | ||
|
@@ -9,7 +10,7 @@ jobs: | |
build_and_deploy_stage: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
contents: write | ||
packages: write | ||
actions: write | ||
steps: | ||
|
@@ -37,6 +38,11 @@ jobs: | |
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Extract version from input (for manual workflow dispatch) | ||
if: github.event_name == 'workflow_dispatch' | ||
run: | | ||
echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
|
@@ -56,11 +62,75 @@ jobs: | |
env: | ||
REPO: "${{ github.repository }}" | ||
|
||
- name: Build and push | ||
- name: Set commit sha | ||
run: | | ||
echo "COMMIT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV | ||
- name: Build and push Version | ||
if: github.event_name == 'push' | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./.docker/Dockerfile.stage | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ghcr.io/${{ env.REPO_LC }}-stage:${{ env.RELEASE_VERSION }}-preview, ghcr.io/${{ env.REPO_LC }}-stage:latest, ghcr.io/${{ env.REPO_LC }}-stage:${{ env.COMMIT_SHA }} | ||
|
||
- name: Build and push Version | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./.docker/Dockerfile.stage | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ghcr.io/${{ env.REPO_LC }}-stage:${{ env.RELEASE_VERSION }}-preview, ghcr.io/${{ env.REPO_LC }}-stage:lastest | ||
tags: ghcr.io/${{ env.REPO_LC }}-stage:latest, ghcr.io/${{ env.REPO_LC }}-stage:${{ env.COMMIT_SHA }} | ||
|
||
- name: "Setup yq" | ||
uses: dcarbone/[email protected] | ||
with: | ||
version: "v4.42.1" | ||
force: true | ||
|
||
- name: Initialize mandatory git config | ||
run: | | ||
git config --global user.name 'GitHub Actions' | ||
git config --global user.email '[email protected]' | ||
- name: Bump version in values/stage.yaml | ||
run: yq -i '.deployment.image.tag=strenv(COMMIT_SHA)' ./k8s/values/stage.yaml | ||
|
||
- name: Commit k8s values files | ||
id: make-commit | ||
run: | | ||
git add ./k8s/values/stage.yaml | ||
git commit --message "Update stage image to commit ${{ env.COMMIT_SHA }}" | ||
echo "::set-output name=commit::$(git rev-parse HEAD)" | ||
- name: Push changes | ||
uses: CasperWA/push-protected@v2 | ||
if: github.event_name == 'push' | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: release/${{ env.RELEASE_VERSION }} | ||
|
||
- name: Push changes | ||
uses: CasperWA/push-protected@v2 | ||
if: github.event_name == 'workflow_dispatch' | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: develop | ||
|
||
- name: Delete tag | ||
uses: dev-drprasad/[email protected] | ||
with: | ||
tag_name: stage-deployment | ||
delete_release: false | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create tag | ||
run: git tag -fa 'stage-deployment' -m "Update tag to commit ${{ env.COMMIT_SHA }}" | ||
|
||
- name: Push tag | ||
run: git push origin stage-deployment |
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,31 @@ | ||
name: "Build project on PR" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: read | ||
actions: read | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: .node-version | ||
|
||
- name: Install Yarn | ||
run: npm install -g yarn | ||
|
||
- name: Install dependencies | ||
run: yarn --frozen-lockfile | ||
|
||
- name: Build project | ||
run: yarn build |
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,72 @@ | ||
name: 'Cleanup Pull Request' | ||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
check-resources: | ||
name: "Check Resources" | ||
runs-on: ubuntu-latest | ||
outputs: | ||
helm_exists: ${{ steps.check_helm.outputs.exists }} | ||
namespace_exists: ${{ steps.check_namespace.outputs.exists }} | ||
|
||
steps: | ||
- name: Kubernetes login | ||
uses: azure/k8s-set-context@v4 | ||
with: | ||
method: kubeconfig | ||
kubeconfig: ${{ secrets.KUBE_CONFIG }} | ||
|
||
- name: Check Helm Chart | ||
id: check_helm | ||
run: | | ||
RELEASE_NAME=project-website-pr-${{ github.event.number }} | ||
if helm list --all --namespace $RELEASE_NAME | grep $RELEASE_NAME; then | ||
echo "::set-output name=exists::true" | ||
else | ||
echo Helm Chart $RELEASE_NAME does not exist | ||
echo "::set-output name=exists::false" | ||
fi | ||
- name: Check Namespace | ||
id: check_namespace | ||
run: | | ||
NAMESPACE=project-website-pr-${{ github.event.number }} | ||
if kubectl get namespace $NAMESPACE; then | ||
echo "::set-output name=exists::true" | ||
else | ||
echo Namespace $NAMESPACE does not exist | ||
echo "::set-output name=exists::false" | ||
fi | ||
cleanup-pr: | ||
name: "Cleanup Pull Request" | ||
runs-on: ubuntu-latest | ||
needs: check-resources | ||
if: needs.check-resources.outputs.helm_exists == 'true' || needs.check-resources.outputs.namespace_exists == 'true' | ||
continue-on-error: true | ||
permissions: | ||
contents: read | ||
packages: write | ||
actions: write | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Kubernetes login | ||
uses: azure/k8s-set-context@v4 | ||
with: | ||
method: kubeconfig | ||
kubeconfig: ${{ secrets.KUBE_CONFIG }} | ||
|
||
- name: Delete Helm Chart | ||
if: needs.check-resources.outputs.helm_exists == 'true' | ||
run: | | ||
RELEASE_NAME=project-website-pr-${{ github.event.number }} | ||
helm delete $RELEASE_NAME --namespace $RELEASE_NAME | ||
- name: Delete Namespace | ||
if: needs.check-resources.outputs.namespace_exists == 'true' | ||
run: | | ||
NAMESPACE=project-website-pr-${{ github.event.number }} | ||
kubectl delete namespace $NAMESPACE |
Oops, something went wrong.