Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
github-actions: merge staging into main (#250)
Browse files Browse the repository at this point in the history
* serve SPA through Kestrel (#249)

* restructure

* update actions

* actions

* fix configuration provider path

* add working Dockerfile

* enforce code style on build

* add missing quotes

* rename aspnet.shared to aspnet.common

* fix cache path
  • Loading branch information
JensDll committed May 29, 2023
1 parent 8d55557 commit e82f7c5
Show file tree
Hide file tree
Showing 174 changed files with 1,622 additions and 1,067 deletions.
10 changes: 8 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ csharp_space_between_square_brackets = false
######## NAMING RULES ########
dotnet_diagnostic.IDE1006.severity = warning

# https://learn.microsoft.com/en-gb/dotnet/fundamentals/code-analysis/quality-rules/ca1707
dotnet_diagnostic.CA1707.severity = none

# All constants are PascalCase
dotnet_naming_symbols.constants.applicable_kinds = field
dotnet_naming_symbols.constants.required_modifiers = const
Expand All @@ -213,10 +216,11 @@ dotnet_naming_rule.constants.symbols = constants
dotnet_naming_rule.constants.style = constants
dotnet_naming_rule.constants.severity = warning

# Namespaces are PascalCase
# Namespaces are lower case
dotnet_naming_symbols.namespaces.applicable_kinds = namespace

dotnet_naming_style.namespaces.capitalization = pascal_case
dotnet_naming_style.namespaces.capitalization = all_lower
dotnet_naming_style.namespaces.word_separator = _

dotnet_naming_rule.namespaces.symbols = namespaces
dotnet_naming_rule.namespaces.style = namespaces
Expand Down Expand Up @@ -314,4 +318,6 @@ resharper_csharp_keep_existing_attribute_arrangement = true
resharper_csharp_max_attribute_length_for_same_line = 9999
# https://www.jetbrains.com/help/resharper/EditorConfig_CSHARP_BracesPageSchema.html#resharper_csharp_empty_block_style
resharper_csharp_empty_block_style = together
# https://www.jetbrains.com/help/resharper/Reference__Code_Inspections_CSHARP.html#LanguageUsage
resharper_introduce_optional_parameters_global_highlighting = hint
######## RESHARPER ########
98 changes: 0 additions & 98 deletions .github/workflows/deploy-docker.yaml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/deploy_docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy docker

on:
workflow_dispatch:
push:
branches:
- main

jobs:
create_tag:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- name: Creating new tag
id: tag
run: |
tag=$(date +"%Y.%m.%d.%H.%M")
echo "tag=$tag" >> $GITHUB_OUTPUT
build_and_push_app:
needs:
- create_tag
environment:
name: DockerHub
runs-on: ubuntu-latest
steps:
- name: Checking out the repository
uses: actions/checkout@v3.5.2

- name: Setting up Quick Emulator (QEMU)
uses: docker/setup-qemu-action@v2.1.0
with:
platforms: linux/arm64,linux/amd64

- name: Setting up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2.4.1

- name: Logging in to Docker Hub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Building and pushing container image
uses: docker/build-push-action@v4.0.0
with:
context: services/steganography.api
# Build sometimes fails on ARM
# https://github.com/NuGet/Home/issues/12227
platforms: |
linux/amd64,linux/arm64
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/steganography:app.latest,
${{ secrets.DOCKER_HUB_USERNAME }}/steganography:app.${{ needs.create-tag.outputs.tag }}
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/steganography:app.cache
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/steganography:app.cache,mode=max
15 changes: 0 additions & 15 deletions .github/workflows/format-api.yaml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/format_steganography.api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Format steganography.api

on:
push:
branches:
- staging

jobs:
should_run:
uses: JensDll/should-run/.github/workflows/main.yaml@main
with:
projects: services/steganography.api

format:
needs: should_run
if: fromJSON(needs.should_run.outputs.result)['services/steganography.api'] == 'true'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: services/steganography.api
steps:
- name: Checking out the repository
uses: actions/checkout@v3.5.2
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
name: Format web
name: Format steganography.web

on:
workflow_call:
push:
branches:
- staging

jobs:
main:
runs-on: ubuntu-latest
should_run:
uses: JensDll/should-run/.github/workflows/main.yaml@main
with:
projects: services/steganography.web

format:
needs: should_run
if: fromJSON(needs.should_run.outputs.result)['services/steganography.web'] == 'true'
defaults:
run:
shell: bash
working-directory: services/web
working-directory: services/steganography.web
runs-on: ubuntu-latest
steps:
- name: Checking out the repository
uses: actions/checkout@v3.5.2
Expand All @@ -24,7 +33,7 @@ jobs:
with:
node-version: 18
cache: "pnpm"
cache-dependency-path: services/web/pnpm-lock.yaml
cache-dependency-path: services/steganography.web/pnpm-lock.yaml

- name: Installing dependencies
run: pnpm install --frozen-lockfile
Expand All @@ -51,16 +60,16 @@ jobs:
- name: Creating pull request
if: steps.prepare.outputs.TEMP_BRANCH != null
id: create-pull
uses: ./.github/actions/create-pull
id: create_pull
uses: ./.github/actions/create_pull
with:
github_token: ${{ secrets.github_token }}
base: staging
head: ${{ steps.prepare.outputs.TEMP_BRANCH }}
title: "github-actions: fix code style"

- name: Merging pull request
if: steps.create-pull.outputs.pull_number != null
if: steps.create_pull.outputs.pull_number != null
uses: ./.github/actions/merge-pull
with:
github_token: ${{ secrets.github_token }}
Expand Down
57 changes: 0 additions & 57 deletions .github/workflows/main.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ on:
workflow_dispatch:

jobs:
create-pull:
create_pull:
runs-on: ubuntu-latest
steps:
- name: Checking out the repository
uses: actions/checkout@v3.5.2

- name: Creating pull request
uses: ./.github/actions/create-pull
id: create-pull
uses: ./.github/actions/create_pull
with:
# Make sure to trigger pull request workflows
github_token: ${{ secrets.WORKFLOW_TOKEN }}
Expand Down
Loading

0 comments on commit e82f7c5

Please sign in to comment.