-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Docker image building workflow and action
- Loading branch information
1 parent
f02a010
commit b3a007c
Showing
3 changed files
with
40 additions
and
28 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Deployment workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_call: | ||
|
||
jobs: | ||
staging: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
strategy: | ||
matrix: | ||
environment: | ||
- staging | ||
- production | ||
max-parallel: 1 | ||
|
||
environment: ${{ matrix.environment }} | ||
|
||
env: | ||
DOCKER_TAG: ${{ matrix.environment == 'production' && 'latest' || 'edge' }} | ||
DOCKER_REGISTRY: ghcr.io | ||
DOCKER_NAMESPACE: ${{ github.repository_owner }} | ||
DOCKER_EXTRA_ARGS: --label org.opencontainers.image.source=https://github.com/${{ github.repository }} --cache-from type=gha,mode=max --cache-to type=gha,mode=max | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: kir-dev/automations/actions/infra-build-images@feat/build-docker-actions | ||
with: | ||
registry: ${{ env.DOCKER_NAMESPACE }} | ||
namespace: ${{ env.DOCKER_NAMESPACE }} | ||
docker-tag: ${{ env.DOCKER_TAG }} | ||
extra-args: --push ${{ env.DOCKER_EXTRA_ARGS }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters