Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomitheninja committed Sep 26, 2024
1 parent cb34527 commit 7b5da96
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/self-dev.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name: Developer workflow
name: CI

on:
pull_request:
push:
branches:
- main
workflow_call:
workflow_dispatch:
inputs:
repo:
type: string
required: false

env:
COUNT_LINES_REPO: ${{ inputs.repo || 'kir-dev/cmsch' }}
TARGET_REPO: ${{ inputs.repo || 'kir-dev/cmsch' }}

jobs:
count-lines:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{ env.COUNT_LINES_REPO }}
repository: ${{ env.TARGET_REPO }}
- uses: kir-dev/automations/actions/count-lines@main
id: counter
with:
Expand All @@ -34,7 +34,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
repository: ${{ env.COUNT_LINES_REPO }}
repository: ${{ env.TARGET_REPO }}
- uses: kir-dev/automations/actions/count-lines-docker@main
id: counter
with:
Expand Down
30 changes: 22 additions & 8 deletions .github/workflows/self-prod.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
name: Deployment workflow
name: Deployment

on:
push:
branches:
- main
pull_request:
workflow_call:
workflow_dispatch:
inputs:
environment:
description: 'Select the environment to deploy'
required: true
type: choice
options:
- staging
- production

jobs:
staging:
depoy:
runs-on: ubuntu-latest

permissions:
Expand All @@ -17,9 +24,8 @@ jobs:

strategy:
matrix:
environment:
- staging
- production
environment: ${{ fromJson(
github.event_name == 'workflow_dispatch' && '[${{ inputs.environment }}]' || '["staging", "production"]') }}
max-parallel: 1

environment: ${{ matrix.environment }}
Expand All @@ -32,7 +38,15 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: kir-dev/automations/actions/infra-build-images@feat/build-docker-actions

- name: Log into registry ${{ env.DOCKER_REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: ./actions/infra-build-images@feat/build-docker-actions
with:
registry: ${{ env.DOCKER_REGISTRY }}
namespace: ${{ env.DOCKER_NAMESPACE }}
Expand Down
4 changes: 2 additions & 2 deletions scripts/build-docker-actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ pushd $CONTEXT
for FILE in *.Dockerfile
do
NAME=${FILE%.Dockerfile}
docker buildx build \
docker buildx build --load \
--file "$FILE" \
--tag "$DOCKER_REPO/$NAME:$TAG" \
$EXTRA_ARGS \
.
done

echo '# Docker images' >> $GITHUB_STEP_SUMMARY
docker images | grep "$DOCKER_REPO" >> $GITHUB_STEP_SUMMARY
docker images "$DOCKER_REPO"/"$NAME"* >> $GITHUB_STEP_SUMMARY

popd

0 comments on commit 7b5da96

Please sign in to comment.