Push to GitHub Packages (ghcr.io/almalinux) only if production (#9)

Correct job name and README.md
This commit is contained in:
Yuriy Kohut 2024-05-09 14:53:10 +03:00 committed by GitHub
parent 9d49b03c39
commit a0e04de416
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -60,7 +60,7 @@ env:
# Registries list: # Registries list:
# for production: docker.io/almalinux, quay.io/almalinuxorg, ghcr.io/almalinux # for production: docker.io/almalinux, quay.io/almalinuxorg, ghcr.io/almalinux
# for testing: quay.io/almalinuxautobot # for testing: quay.io/almalinuxautobot
registries: ${{ inputs.production && 'docker.io/almalinux, quay.io/almalinuxorg, ghcr.io/almalinux' || 'quay.io/almalinuxautobot, ghcr.io/almalinux' }} registries: ${{ inputs.production && 'docker.io/almalinux, quay.io/almalinuxorg, ghcr.io/almalinux' || 'quay.io/almalinuxautobot' }}
jobs: jobs:
build-test-push: build-test-push:
@ -386,7 +386,7 @@ jobs:
optimize-repo-size: optimize-repo-size:
# 'default' or 'minimal' images only and 'Push to production' is checked # 'default' or 'minimal' images only and 'Push to production' is checked
if: ( inputs.type_default || inputs.type_minimal ) && inputs.production if: ( inputs.type_default || inputs.type_minimal ) && inputs.production
name: Optimize ${{ github.repository }} size of the branch '${{ inputs.version_major }}' name: Optimize size of repository
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- build-test-push - build-test-push

View File

@ -444,7 +444,7 @@ Tree illustration of the workflow Jobs and Steps for AlmaLinux 9 minimal image:
  ├── Post Checkout _container-images, branch 'main'   ├── Post Checkout _container-images, branch 'main'
  └── Complete job   └── Complete job
└── Optimize almalinux/container-images size of the branch '9' └── Optimize size of repository
├── Checkout almalinux/container-images, branch '9', path '9' ├── Checkout almalinux/container-images, branch '9', path '9'
├── Optimize size of branch the '9' ├── Optimize size of branch the '9'
└── Commit and push almalinux/container-images, branch '9' └── Commit and push almalinux/container-images, branch '9'
@ -632,15 +632,15 @@ AlmaLinux ${version_major}-${images_type} image build as of ${date_stamp} (with
``` ```
It includes the AlmaLinux version major, image type, build date, and reference to this GitHub Action. It includes the AlmaLinux version major, image type, build date, and reference to this GitHub Action.
### Optimize almalinux/container-images size of the branch '${version_major}' ### Job: Optimize size of repository
❗ Skip the job if the image type is not 'default' or 'minimal', or '*Push to production registries*' is not checked (`inputs.production` set to `false`.) ❗ Skip the job if the image type is not 'default' or 'minimal', or '*Push to production registries*' is not checked (`inputs.production` set to `false`.)
#### Checkout almalinux/container-images, branch '${version_major}', path '${version_major}' #### Step: Checkout almalinux/container-images, branch '${version_major}', path '${version_major}'
The [actions/checkout@v4](https://github.com/actions/checkout/) checkouts *container-images* into branch '${version_major}'. The repository directory is located at `/home/runner/work/container-images/container-images` and its subdirectory is named '${version_major}'. All commits for the branch are checkout with `fetch-depth: 0`. The [actions/checkout@v4](https://github.com/actions/checkout/) checkouts *container-images* into branch '${version_major}'. The repository directory is located at `/home/runner/work/container-images/container-images` and its subdirectory is named '${version_major}'. All commits for the branch are checkout with `fetch-depth: 0`.
#### Optimize size of branch the '${version_major}' #### Step: Optimize size of branch the '${version_major}'
This step is written in bash and is designed to: This step is written in bash and is designed to:
- preserves 'default' and 'minimal' folders with Dockerfiles and RootFSs into `../tmp-${date_stamp}` folder - preserves 'default' and 'minimal' folders with Dockerfiles and RootFSs into `../tmp-${date_stamp}` folder
@ -649,7 +649,7 @@ This step is written in bash and is designed to:
- checkouts into orphan ${version_major} branch - checkouts into orphan ${version_major} branch
- restores 'default' and 'minimal' folders into the orphan branch placeholder - restores 'default' and 'minimal' folders into the orphan branch placeholder
#### Commit and push almalinux/container-images, branch '${version_major}' #### Step: Commit and push almalinux/container-images, branch '${version_major}'
Uses [EndBug/add-and-commit@v9](https://github.com/marketplace/actions/add-commit) to commit and push Dockerfiles and RootFSs which were prepared on previous step. Uses [EndBug/add-and-commit@v9](https://github.com/marketplace/actions/add-commit) to commit and push Dockerfiles and RootFSs which were prepared on previous step.
The following options are used to push: The following options are used to push: