dind-bash/.forgejo/workflows/build.yml

67 lines
2.6 KiB
YAML
Raw Normal View History

2023-11-16 17:38:37 +00:00
name: 'Build Custom docker:dind image'
author: 'Neshura'
2023-11-27 14:29:37 +00:00
on:
push:
schedule:
- cron: '0 0 * * 1'
2023-11-16 17:38:37 +00:00
jobs:
build-container:
runs-on: dind
steps:
-
name: Install Node.js
2023-11-16 19:10:00 +00:00
run: apk add nodejs npm
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: forgejo.neshweb.net
username: ${{ secrets.FORGEJO_USERNAME }}
password: ${{ secrets.FORGEJO_TOKEN }}
-
name: Push to Package Registry
uses: docker/build-push-action@v5
with:
push: true
2023-12-20 06:53:24 +00:00
tags: forgejo.neshweb.net/ci-docker-images/dind-bash:latest
build-container-fallback:
2023-12-20 07:01:33 +00:00
needs: build-container
2023-12-20 07:02:04 +00:00
if: always() && needs.build-container.result == 'failure'
2023-11-16 17:43:19 +00:00
runs-on: docker
2023-11-16 17:38:37 +00:00
steps:
2023-11-16 17:46:46 +00:00
-
name: Prepare Container Environment
2023-11-16 17:49:18 +00:00
run: |
install -m 0755 -d /etc/apt/keyrings; \
2023-11-16 17:50:06 +00:00
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg; \
2023-11-16 17:49:18 +00:00
chmod a+r /etc/apt/keyrings/docker.gpg; \
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
2023-11-16 17:50:06 +00:00
tee /etc/apt/sources.list.d/docker.list > /dev/null; \
2023-11-16 17:49:18 +00:00
apt-get update; \
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
-
name: Install Node.js
run: apk add nodejs npm
2023-11-16 17:38:37 +00:00
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
2023-11-16 18:27:54 +00:00
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: forgejo.neshweb.net
username: ${{ secrets.FORGEJO_USERNAME }}
password: ${{ secrets.FORGEJO_TOKEN }}
2023-11-16 17:38:37 +00:00
-
name: Push to Package Registry
uses: docker/build-push-action@v5
with:
push: true
2023-12-20 06:53:24 +00:00
tags: forgejo.neshweb.net/ci-docker-images/dind-bash:latest