ContainersWorkspace/.forgejo/workflows/build-images.yml

66 lines
2.3 KiB
YAML
Raw Permalink Normal View History

2023-11-15 14:54:00 +00:00
name: Build images
run-name: Build images
on:
push:
branches: [ "main" ]
schedule:
2023-12-31 09:48:18 +00:00
- cron: '30 5 */10 * *'
2023-11-15 14:54:00 +00:00
2024-03-17 15:29:46 +00:00
env:
IMAGES: system-toolbox cloud-toolbox tor zabbix-agent snowflake gui-container
2023-11-15 14:54:00 +00:00
jobs:
build-images-arm64:
2024-02-08 20:21:53 +00:00
runs-on: [ arm64 ]
2023-11-15 14:54:00 +00:00
steps:
- name: install actions deps
run: |
dnf install -y nodejs git
- name: Check out repository code
uses: actions/checkout@v3
- name: login to registry
2024-02-08 20:21:53 +00:00
run: podman login -u "${{ secrets.PACKAGES_USERNAME }}" -p "${{ secrets.PACKAGES_PASSWD }}" forgejo.maciej.cloud
2023-11-15 14:54:00 +00:00
- name: Build selected images
run: |
2024-03-17 15:29:46 +00:00
for image in ${IMAGES};
2023-11-15 14:54:00 +00:00
do
echo "building image $image";
2024-04-05 12:38:14 +00:00
podman build --ulimit nofile=10240:10240 ./$image --tag forgejo.maciej.cloud/pkg/$image:arm64;
2023-11-15 14:54:00 +00:00
echo "pushing image $image";
2024-02-08 20:21:53 +00:00
podman push forgejo.maciej.cloud/pkg/$image:arm64;
2023-11-15 14:54:00 +00:00
done
build-images-amd64:
2024-02-08 20:21:53 +00:00
runs-on: [ amd64 ]
2023-11-15 14:54:00 +00:00
steps:
- name: install actions deps
run: |
dnf install -y nodejs git
- name: Check out repository code
uses: actions/checkout@v3
- name: login to registry
2024-02-08 20:21:53 +00:00
run: podman login -u "${{ secrets.PACKAGES_USERNAME }}" -p "${{ secrets.PACKAGES_PASSWD }}" forgejo.maciej.cloud
2023-11-15 14:54:00 +00:00
- name: Build selected images
run: |
2024-03-17 15:29:46 +00:00
for image in ${IMAGES};
2023-11-15 14:54:00 +00:00
do
echo "building image $image";
2024-04-05 12:38:14 +00:00
podman build --ulimit nofile=10240:10240 ./$image --tag forgejo.maciej.cloud/pkg/$image:amd64;
2023-11-15 14:54:00 +00:00
echo "pushing image $image";
2024-02-08 20:21:53 +00:00
podman push forgejo.maciej.cloud/pkg/$image:amd64;
2023-11-15 14:54:00 +00:00
done
update-images-manifests:
2024-02-08 20:21:53 +00:00
runs-on: [ amd64 ]
2023-11-15 14:54:00 +00:00
needs:
- build-images-amd64
- build-images-arm64
steps:
- name: login to registry
2024-02-08 20:21:53 +00:00
run: podman login -u "${{ secrets.PACKAGES_USERNAME }}" -p "${{ secrets.PACKAGES_PASSWD }}" forgejo.maciej.cloud
2023-11-15 14:54:00 +00:00
- name: Create manifests and push
run: |
2024-03-17 15:29:46 +00:00
for image in ${IMAGES};
2023-11-15 14:54:00 +00:00
do
echo "Updating manifest for $image";
2024-02-08 20:21:53 +00:00
podman manifest create forgejo.maciej.cloud/pkg/$image:latest forgejo.maciej.cloud/pkg/$image:amd64 forgejo.maciej.cloud/pkg/$image:arm64;
podman manifest push forgejo.maciej.cloud/pkg/$image:latest forgejo.maciej.cloud/pkg/$image:latest;
2023-11-15 14:54:00 +00:00
done