Skip to content

Commit

Permalink
Merge pull request #2 from mondata-dev/actions
Browse files Browse the repository at this point in the history
Move to github actions
  • Loading branch information
faberto authored Jan 29, 2024
2 parents 8f402ef + 0a1cf3d commit c66cb5b
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 65 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build-backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build Backend Docker Image

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ created ]

permissions:
contents: read
packages: write

jobs:
build_docker:
runs-on: ubuntu-22.04
name: Build & publish docker image
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}-backend
flavor: latest=true

- name: Login to image repository
if: github.ref_type == 'tag'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
with:
context: ./backend
file: backend/Dockerfile
push: ${{ github.ref_type == 'tag' }}
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
47 changes: 47 additions & 0 deletions .github/workflows/build-frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build Frontend Docker Image

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ created ]

permissions:
contents: read
packages: write

jobs:
build_docker:
runs-on: ubuntu-22.04
name: Build & publish docker image
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}-frontend
flavor: latest=true

- name: Login to image repository
if: github.ref_type == 'tag'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
with:
context: .
file: Dockerfile
push: ${{ github.ref_type == 'tag' }}
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
63 changes: 0 additions & 63 deletions .gitlab-ci.yml

This file was deleted.

3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ RUN --mount=type=cache,target=/root/.npm \
# copy over all files to the work directory
ADD . /app

# make the postbuild.sh executable
RUN chmod +x /app/postbuild.sh

# In the first build there sometimes is a problem with the
# stq-card-header-large-font; however this problem typically
# disappears in the second build
Expand Down
2 changes: 1 addition & 1 deletion k8s/backend-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
serviceAccountName: staqe-backend
containers:
- name: staqe
image: docker.io/mondata/staqe-backend:latest
image: ghcr.io/mondata-dev/staqe-backend:latest
ports:
- name: http
containerPort: 3300
Expand Down
2 changes: 1 addition & 1 deletion k8s/nuxt-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
spec:
containers:
- name: nuxt
image: docker.io/mondata/staqe-app:latest
image: ghcr.io/mondata-dev/staqe-frontend:latest
ports:
- name: http
containerPort: 3000
Expand Down

0 comments on commit c66cb5b

Please sign in to comment.