Skip to content

Commit

Permalink
fix: workflow not reusable
Browse files Browse the repository at this point in the history
  • Loading branch information
tiptenbrink committed Dec 6, 2023
1 parent 51d68f2 commit 9026c1e
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 12 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@ name: CI

permissions:
packages: read
contents: read

on:
pull_request:
push:
branches:
- main
workflow_call:

jobs:
backend-ci:
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
env:
backend_path: ${{ github.workspace }}/backend
steps:
- uses: actions/checkout@v4
- run: pipx install poetry==1.7.1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

permissions:
packages: write
contents: write

jobs:
backend-ci:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ on:
required: true
type: string

permissions:
packages: write
contents: read

jobs:
build-db:
runs-on: ubuntu-latest
# In case of production only run when it is a non-prerelease release
if: ${{ inputs.env != 'production' }} || ${{ github.event_name == 'release' && !github.event.release.prerelease }}
if: ${{ inputs.env != 'production' || (github.event_name == 'release' && !github.event.release.prerelease) }}
defaults:
run:
working-directory: deploy
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/kv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ on:
required: true
type: string

permissions:
packages: write
contents: read

jobs:
build-kv:
runs-on: ubuntu-latest
# In case of production only run when it is a non-prerelease release
if: ${{ inputs.env != 'production' }} || ${{ github.event_name == 'release' && !github.event.release.prerelease }}
if: ${{ inputs.env != 'production' || (github.event_name == 'release' && !github.event.release.prerelease) }}
defaults:
run:
working-directory: deploy
steps:
- uses: actions/checkout@v4
- run: pipx install poetry==1.7.1
Expand Down Expand Up @@ -54,7 +61,7 @@ jobs:
password: ${{ github.token }}
# Set up buildx for later build-push-action
- name: Set up Docker Buildx
uses: docker/setup-2buildx-action@v3
uses: docker/setup-buildx-action@v3

# *************************************************
# ************** SET CONTAINER TAGS ***************
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ on:
required: true
type: string

permissions:
packages: write
contents: read

jobs:
build-server:
runs-on: ubuntu-latest
# In case of production only run when it is a non-prerelease release
if: ${{ inputs.env != 'production' }} || ${{ github.event_name == 'release' && !github.event.release.prerelease }}
if: ${{ inputs.env != 'production' || (github.event_name == 'release' && !github.event.release.prerelease) }}
defaults:
run:
working-directory: deploy
steps:
- uses: actions/checkout@v4
- run: pipx install poetry==1.7.1
Expand All @@ -32,6 +39,7 @@ jobs:
# dotglob is enabled to also allow the '.*' files to be moved
# Finally configuration files for building authpage is moved (TEMP until confspawn option)
- name: Move source
working-directory: ${{ github.workspace }}
run: |
mv backend/poetry.lock deploy/context
mv backend//pyproject.toml deploy/context
Expand All @@ -53,10 +61,10 @@ jobs:
cache-dependency-path: deploy/context/authpage/package-lock.json
- name: Build credentials
if: ${{ (github.event_name == 'release' && github.event.action == 'published') || steps.cached-authpage.outputs.cache-hit != 'true' }}
working-directory: ${{ github.workspace }}/deploy/context/authpage
run: |
npm install
npm run build-mode -- --mode ${{ inputs.env }}
working-directory: deploy/context/authpage
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion authpage/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default defineConfig({
reset: resolve(__dirname, 'reset/index.html')
}
},
outDir: '../src/apiserver/resources/static/credentials'
outDir: '../backend/src/apiserver/resources/static/credentials'
},
server: {
port: 4244
Expand Down

0 comments on commit 9026c1e

Please sign in to comment.