Skip to content

Commit

Permalink
test docker and electron build
Browse files Browse the repository at this point in the history
  • Loading branch information
fynnfluegge committed Nov 17, 2024
1 parent b22de29 commit 58c1332
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

name: Pull Request Build
name: Main Build

on:
pull_request:
branches: [ main ]
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Build

on:
# push:
# tags:
# - "*.*.*"
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
uses: ./.github/workflows/workflow-build.yaml
6 changes: 3 additions & 3 deletions .github/workflows/build.yml → .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build

on:
push:
branches: [ main ]
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ name: Deploy

on:
workflow_run:
workflows: [ Build ]
branches: [ main ]
types: [ completed ]

workflows: [Main Build]
types: [completed]

concurrency:
group: ${{ github.ref }}
cancel-in-progress: false
Expand Down Expand Up @@ -36,7 +35,7 @@ jobs:
with:
node-version: 18

- name: Install AWS CDK
- name: Install AWS CDK
run: |
npm install -g aws-cdk
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/electron-build-and-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Electron Build and Publish

on:
workflow_run:
workflows: [Release Build]
types: [completed]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3

- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Build electron app
run: |
cd webapp
npm ci
npm run build-electron
env:
AWS_REGION: ${{ vars.AWS_REGION }}
DOMAIN_NAME: ${{ vars.DOMAIN_NAME }}
API_URL: ${{ vars.API_URL }}
COGNITO_USER_POOL_ID: ${{ vars.COGNITO_USER_POOL_ID }}
COGNITO_APP_CLIENT_ID: ${{ vars.COGNITO_APP_CLIENT_ID }}
REDIRECT_SIGN_IN: ${{ vars.REDIRECT_SIGN_IN }}
REDIRECT_SIGN_OUT: ${{ vars.REDIRECT_SIGN_OUT }}
AUTH_GUARD_REDIRECT: ${{ vars.AUTH_GUARD_REDIRECT }}
8 changes: 3 additions & 5 deletions .github/workflows/publish-docker-image.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Release Build and Push

on:
push:
tags:
- "*.*.*"
workflow_run:
workflows: [Release Build]
types: [completed]

env:
REGISTRY_IMAGE_API: fynnfluegge/rocketnotes-api
Expand Down Expand Up @@ -47,7 +47,6 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.REGISTRY_IMAGE_API }}:${{ env.RELEASE_TAG }}
${{ env.REGISTRY_IMAGE_API }}:latest
- name: Build and push Docker image webapp
Expand All @@ -57,5 +56,4 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.REGISTRY_IMAGE_WEBAPP }}:${{ env.RELEASE_TAG }}
${{ env.REGISTRY_IMAGE_WEBAPP }}:latest
2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webapp",
"version": "1.0.2",
"version": "1.0.0",
"main": "electron.js",
"scripts": {
"ng": "ng",
Expand Down

0 comments on commit 58c1332

Please sign in to comment.