-
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.
- Loading branch information
1 parent
142c6e2
commit 818af88
Showing
17 changed files
with
1,193 additions
and
85 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,3 @@ | ||
DEV_MODE="true" | ||
HEROKU_API_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | ||
DEV_ACCESS_PASSPHRASE="xxxxxxxxxxxxxxxxxxxxxxxxxxx" |
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,12 @@ | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
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,53 @@ | ||
name: Continuous Deployment - Development Backend Service | ||
on: ["push", "pull_request"] | ||
#workflow_run: | ||
# workflows: ["Continuous Integration - Development Backend Service"] | ||
# types: | ||
# - completed | ||
permissions: write-all | ||
|
||
jobs: | ||
cd: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Login to Leo Cloud Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: registry.cloud.htl-leonding.ac.at | ||
username: ${{ secrets.LEOCLOUD_EMAIL }} | ||
password: ${{ secrets.LEOCLOUD_PASSWORD }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: Dockerfile | ||
push: true | ||
tags: | | ||
propromo/rest-microservice:latest | ||
ghcr.io/${{ github.repository_owner }}/propromo-rest-microservice:latest | ||
registry.cloud.htl-leonding.ac.at/j.froeller/rest-microservice:latest |
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,63 @@ | ||
name: Release - Development Backend Service | ||
on: | ||
workflow_run: | ||
workflows: ["Continuous Deployment - Development Backend Service"] | ||
types: | ||
- completed | ||
permissions: write-all | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get latest release tag | ||
id: get_latest_tag | ||
run: | | ||
# LATEST_TAG=$(git ls-remote --tags origin | grep -v '^{}' | grep -v '^{} ' | awk '{print $2}' | sed 's/refs\/tags\///' | sort -V | tail -n 1) | ||
git pull --tags | ||
LATEST_TAG=$(git tag --sort=-version:refname | head -n 1) | ||
echo "latest_remote_tag=${LATEST_TAG}" | ||
if [[ -z "${LATEST_TAG}" || ! "${LATEST_TAG}" =~ $(date +"%Y.%m.%d") ]]; then | ||
TAG=$(date +"%Y.%m.%d.1") | ||
echo "creating new tag: latest_tag=${TAG}" >> $GITHUB_ENV | ||
else | ||
echo "using remote tag: latest_tag=${LATEST_TAG}" >> $GITHUB_ENV | ||
fi | ||
- name: Generate release tag | ||
id: generate_release_tag | ||
run: | | ||
if [[ -z "${latest_tag}" ]]; then | ||
TAG=$(date +"%Y.%m.%d.1") | ||
else | ||
IFS='.' read -r YYYY MM DD I <<< "${latest_tag}" | ||
echo "latest_tag=$latest_tag" | ||
echo "YYYY=$YYYY" | ||
echo "MM=$MM" | ||
echo "DD=$DD" | ||
echo "I=$I" | ||
TAG="${YYYY}.${MM}.${DD}.$((I+1))" | ||
echo "TAG=$TAG" | ||
fi | ||
echo "next_release_tag=${TAG}" >> $GITHUB_OUTPUT | ||
- name: Create Release | ||
id: create_release | ||
uses: ncipollo/release-action@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag: ${{ steps.generate_release_tag.outputs.next_release_tag }} | ||
name: Release ${{ steps.generate_release_tag.outputs.next_release_tag }} | ||
generateReleaseNotes: true | ||
draft: false | ||
prerelease: true | ||
makeLatest: true |
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,2 +1,3 @@ | ||
build | ||
node_modules | ||
.env |
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,32 @@ | ||
FROM node:20.12-bookworm-slim AS development | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm install | ||
|
||
COPY . . | ||
|
||
RUN npm run build | ||
|
||
|
||
FROM node:20.12-bullseye AS production | ||
|
||
WORKDIR /usr/src/app | ||
|
||
RUN curl https://cli-assets.heroku.com/install.sh | sh | ||
ENV PATH="${PATH}:/usr/local/bin/heroku" | ||
RUN echo 'export PATH="/usr/local/bin/heroku:$PATH"' >> ~/.bashrc | ||
RUN . ~/.bashrc | ||
RUN heroku --version | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm install --only=production | ||
|
||
COPY --from=development /usr/src/app/build ./build | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["node", "build/index.js"] |
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
Oops, something went wrong.