From 1ebfe082b5fa6527756818dd9400be8cc82a4ba0 Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 2 Dec 2020 10:57:25 +0100 Subject: [PATCH 1/7] Add docker action Signed-off-by: trivernis --- .github/workflows/docker.yml | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..625a195 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,45 @@ +name: Build Docker Image + +on: + push: + branches: [ main, actions ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: Copy Repo Files + uses: actions/checkout@master + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.CR_PAT }} + + - name: Login to Portus + uses: docker/login-action@v1 + with: + registry: https://flotte-docker-registry.spdns.org/ + username: ${{ secrets.PORTUS_USERNAME }} + password: ${{ secrets.PORTUS_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm/v7,linux/arm64 + push: true + tags: | + flotte-docker-registry.spdns.org/frontend-server:latest + ghcr.io/flotte-meets-hwr-db/frontend/frontend-server From 46477a47dcdcfdb205da262b3f1f156f331f998c Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 2 Dec 2020 10:58:24 +0100 Subject: [PATCH 2/7] Remove github container registry Signed-off-by: trivernis --- .github/workflows/docker.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 625a195..8001f3e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -19,13 +19,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.CR_PAT }} - - name: Login to Portus uses: docker/login-action@v1 with: @@ -42,4 +35,3 @@ jobs: push: true tags: | flotte-docker-registry.spdns.org/frontend-server:latest - ghcr.io/flotte-meets-hwr-db/frontend/frontend-server From 7af1efa24fc1052b133c3564d214ba10617717bf Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 2 Dec 2020 11:14:20 +0100 Subject: [PATCH 3/7] Add python setup for node-gyp Signed-off-by: trivernis --- .github/workflows/docker.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8001f3e..d68c812 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -12,6 +12,12 @@ jobs: - name: Copy Repo Files uses: actions/checkout@master + - + name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + architecture: 'x64' - name: Set up QEMU uses: docker/setup-qemu-action@v1 From 988b4cf7fb3ce6ebe5b2758395378e7d6797bf2f Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 2 Dec 2020 11:15:23 +0100 Subject: [PATCH 4/7] Fix yaml syntax error Signed-off-by: trivernis --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d68c812..a237e61 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -15,9 +15,9 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 - with: - python-version: '3.x' - architecture: 'x64' + with: + python-version: '3.x' + architecture: 'x64' - name: Set up QEMU uses: docker/setup-qemu-action@v1 From 94af6befd0a9bd679c9c162856f1a4b731db99a6 Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 2 Dec 2020 11:27:51 +0100 Subject: [PATCH 5/7] Remove multiarch and add python to Dockerfile Signed-off-by: trivernis --- .github/workflows/docker.yml | 8 +------- Dockerfile | 3 ++- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a237e61..ed87270 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -12,12 +12,6 @@ jobs: - name: Copy Repo Files uses: actions/checkout@master - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - architecture: 'x64' - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -37,7 +31,7 @@ jobs: with: context: . file: ./Dockerfile - platforms: linux/amd64,linux/arm/v7,linux/arm64 + platforms: linux/amd64 #,linux/arm/v7,linux/arm64 push: true tags: | flotte-docker-registry.spdns.org/frontend-server:latest diff --git a/Dockerfile b/Dockerfile index a33ada4..9ca613e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM node:14.14.0-alpine3.10 AS builder WORKDIR / COPY package.json package-lock.json ./ +RUN apk add --no-cache python3 RUN npm install && npm install -g @angular/cli && mkdir frontend RUN mv node_modules ./frontend WORKDIR /frontend @@ -12,7 +13,7 @@ FROM golang:1.13.4-alpine as builder2 ARG ARCH=amd64 RUN apk add git WORKDIR / -COPY --from=builder /frontend/dist /dist +COPY --from=builder /frontend/dist /dist RUN go get github.com/rakyll/statik RUN statik --src=/dist/flotte-frontend COPY *.go *.sum *.mod / From 63f6104e20746ecc86fa3617d110fccc7f64cfe2 Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 2 Dec 2020 11:33:09 +0100 Subject: [PATCH 6/7] Add multiarch again but remove actions push hook Signed-off-by: trivernis --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ed87270..5dc27e0 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,7 @@ name: Build Docker Image on: push: - branches: [ main, actions ] + branches: [ main ] workflow_dispatch: jobs: @@ -31,7 +31,7 @@ jobs: with: context: . file: ./Dockerfile - platforms: linux/amd64 #,linux/arm/v7,linux/arm64 + platforms: linux/amd64,linux/arm/v7,linux/arm64 push: true tags: | flotte-docker-registry.spdns.org/frontend-server:latest From 0c5467b3cad30c183747892894d1ad878d13e27c Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 2 Dec 2020 11:34:19 +0100 Subject: [PATCH 7/7] Add status badge to README Signed-off-by: trivernis --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eadd3e0..e733c3e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # FlotteFrontend -[![Build Status](https://travis-ci.com/fLotte-meets-HWR-DB/frontend.svg?token=YfRmpHAXqyUafCgSEexw&branch=master)](https://travis-ci.com/fLotte-meets-HWR-DB/frontend) +![Build Docker Image](https://github.com/fLotte-meets-HWR-DB/frontend/workflows/Build%20Docker%20Image/badge.svg) This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.0.8. @@ -59,4 +59,4 @@ We can't pass it in an other form, else it would not be possible to pass a value If the backend url changes, it has to be changed in the following files: - ./src/environments/ - ./apollo.config.js for autocompletion when writing queries etc. -- ./codegen.yml for graphQL codegen (to generate schema, types etc.) \ No newline at end of file +- ./codegen.yml for graphQL codegen (to generate schema, types etc.)