-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create dedicated workflows for the lite image
- Loading branch information
1 parent
0cea804
commit 0f5cec2
Showing
4 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
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,65 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
registry: | ||
required: true | ||
type: string | ||
do_tag: | ||
required: true | ||
type: string # boolean exists, but that will be a string as ENV VAR. Set to YES or NOPE | ||
secrets: | ||
token: | ||
required: true | ||
|
||
jobs: | ||
reusable: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
if: ${{github.event_name != 'pull_request'}} | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ inputs.registry }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.token }} | ||
|
||
- name: Do some shell magic | ||
if: ${{ github.event_name != 'pull_request'}} | ||
shell: bash | ||
id: sh_settings | ||
env: | ||
DO_TAG: ${{inputs.do_tag}} | ||
run: | | ||
if [ $DO_TAG = 'YES' ]; then | ||
echo "tag=lite-${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | ||
else | ||
echo "tag=lite" >> $GITHUB_OUTPUT | ||
fi | ||
echo "repository=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT | ||
- name: '[LITE] Build and push container image' | ||
id: push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
cache-from: ${{inputs.registry}}/${{github.repository}}/tools:${{ steps.sh_settings.outputs.tag }} | ||
file: docker/Dockerfile.lite | ||
context: docker | ||
tags: ${{inputs.registry}}/${{ steps.sh_settings.outputs.repository }}/tools:${{ steps.sh_settings.outputs.tag }} | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{github.event_name != 'pull_request'}} | ||
|
||
- name: '[LITE] Generate artifact attestation' | ||
if: ${{github.event_name != 'pull_request'}} | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-name: ${{ inputs.registry }}//${{ steps.sh_settings.outputs.repository }} | ||
subject-digest: ${{ steps.push.outputs.digest }} | ||
push-to-registry: true | ||
|
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,26 @@ | ||
name: Tools [LITE] Container - Publish | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'docker/**' | ||
- '.github/**' | ||
|
||
jobs: | ||
publish_latest: | ||
name: Push latest [LITE] container image to GitHub Packages | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
uses: .github/workflows/shared-steps.yml | ||
with: | ||
registry: ghcr.io | ||
do_tag: 'NOPE' | ||
secrets: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
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,15 @@ | ||
name: '[LITE] Tools Container - PR Validation' | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- 'docker/**' | ||
|
||
jobs: | ||
pr_validation: | ||
name: '[LITE] PR Validation' | ||
uses: .github/workflows/shared-steps.yml | ||
with: | ||
registry: ghcr.io | ||
do_tag: 'NOPE' |
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,22 @@ | ||
name: '[LITE] Tools Container - Publish Tag' | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
publish_latest: | ||
name: '[LITE] Push tagged container image to GitHub Packages' | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
uses: .github/workflows/shared-steps.yml | ||
with: | ||
registry: ghcr.io | ||
do_tag: 'YES' | ||
secrets: | ||
token: ${{ secrets.GITHUB_TOKEN }} |