-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to publish container images on github
Note that variable expansion in --from and FROM was working oddly, see: docker/cli#3356 (comment) for context.
- Loading branch information
Showing
25 changed files
with
226 additions
and
88 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,26 @@ | ||
name: Dockerfiles Release | ||
on: [create] | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | ||
cancel-in-progress: true | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
jobs: | ||
release: | ||
if: (github.event_name == 'create' && github.event.ref_type == 'tag') | ||
name: Release | ||
strategy: | ||
fail-fast: false | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Code Checkout | ||
uses: actions/checkout@v4 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and Push | ||
run: ./build-and-push-images.sh ${{ github.event.ref }} |
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,54 @@ | ||
#!/bin/bash | ||
|
||
set -eu -o pipefail | ||
|
||
create_image() { | ||
local name="$1" | ||
local ver="$2" | ||
pushd "${name}" | ||
docker build -t ghcr.io/clearlinux/"${name}":"${ver}" . --build-arg="clear_ver=${ver}" | ||
popd | ||
} | ||
|
||
push_image() { | ||
local name="$1" | ||
local ver="$2" | ||
docker push ghcr.io/clearlinux/"${name}":"${ver}" | ||
} | ||
|
||
build_and_push_image() { | ||
local name="$1" | ||
local ver="$2" | ||
create_image "${name}" "${ver}" | ||
push_image "${name}" "${ver}" | ||
} | ||
|
||
main() { | ||
local ver="$1" | ||
build_and_push_image os-core "${ver}" | ||
build_and_push_image clr-installer-ci "${ver}" | ||
# httpd is used by cgit so it must be pushed first | ||
build_and_push_image httpd "${ver}" | ||
build_and_push_image cgit "${ver}" | ||
build_and_push_image golang "${ver}" | ||
build_and_push_image haproxy "${ver}" | ||
build_and_push_image iperf "${ver}" | ||
build_and_push_image mariadb "${ver}" | ||
build_and_push_image memcached "${ver}" | ||
build_and_push_image mixer-ci "${ver}" | ||
build_and_push_image nginx "${ver}" | ||
build_and_push_image node "${ver}" | ||
build_and_push_image numpy-mp "${ver}" | ||
build_and_push_image perl "${ver}" | ||
build_and_push_image php "${ver}" | ||
build_and_push_image php-fpm "${ver}" | ||
build_and_push_image postgres "${ver}" | ||
build_and_push_image python "${ver}" | ||
build_and_push_image rabbitmq "${ver}" | ||
build_and_push_image r-base "${ver}" | ||
build_and_push_image redis "${ver}" | ||
build_and_push_image ruby "${ver}" | ||
build_and_push_image tesseract-ocr "${ver}" | ||
} | ||
|
||
main $1 |
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.