Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build and Deploy Backend

on:
push:
branches: ['master']

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
defaults:
run:
working-directory: user-backend
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'

- name: Build Maven project
run: mvn clean package

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: ./user-backend
file: ./user-backend/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
56 changes: 56 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build & Deploy frontend

on:
push:
branches: [ master ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

GHRC_USERNAME: ${{ secrets.GHRC_USERNAME }}
GHRC_TOKEN: ${{ secrets.GHRC_TOKEN }}

jobs:
build-and-deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: user-frontend
permissions:
contents: read
packages: write
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
run: npm install --force

- name: Build Project
run: npm run build

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: ./user-frontend
file: ./user-frontend/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
35 changes: 0 additions & 35 deletions .github/workflows/maven.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "automatic"
}
32 changes: 32 additions & 0 deletions k8s-correct/backend-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: user-backend-deployment
spec:
replicas: 1
selector:
matchLabels:
app: user-backend
template:
metadata:
labels:
app: user-backend
spec:
containers:
- name: user-backend
image: bansikah/user-backend:1.0
ports:
- containerPort: 8082
---
apiVersion: v1
kind: Service
metadata:
name: user-backend-service
spec:
selector:
app: user-backend
ports:
- protocol: TCP
port: 8082
targetPort: 8082
type: ClusterIP
32 changes: 32 additions & 0 deletions k8s-correct/frontend-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: user-frontend-deployment
spec:
replicas: 1
selector:
matchLabels:
app: user-frontend
template:
metadata:
labels:
app: user-frontend
spec:
containers:
- name: user-frontend
image: bansikah/user-frontend:1.0
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: user-frontend-service
spec:
selector:
app: user-frontend
ports:
- protocol: TCP
port: 80
targetPort: 80
type: NodePort
30 changes: 30 additions & 0 deletions social-login/HELP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Read Me First
The following was discovered as part of building this project:

* The original package name 'com.bansikah.social-login' is invalid and this project uses 'com.bansikah.social_login' instead.

# Getting Started

### Reference Documentation
For further reference, please consider the following sections:

* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/3.3.3/maven-plugin)
* [Create an OCI image](https://docs.spring.io/spring-boot/3.3.3/maven-plugin/build-image.html)
* [Spring Web](https://docs.spring.io/spring-boot/docs/3.3.3/reference/htmlsingle/index.html#web)
* [OAuth2 Client](https://docs.spring.io/spring-boot/docs/3.3.3/reference/htmlsingle/index.html#web.security.oauth2.client)

### Guides
The following guides illustrate how to use some features concretely:

* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)

### Maven Parent overrides

Due to Maven's design, elements are inherited from the parent POM to the project POM.
While most of the inheritance is fine, it also inherits unwanted elements like `<license>` and `<developers>` from the parent.
To prevent this, the project POM contains empty overrides for these elements.
If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides.