commit 2227bdf404638ee17c3d38bbebdb542e30e953f6 Author: Ryan Date: Sat Oct 18 00:50:48 2025 +0200 Hello infra.docker diff --git a/.gitea/workflows/on-push.yaml b/.gitea/workflows/on-push.yaml new file mode 100644 index 0000000..69d181c --- /dev/null +++ b/.gitea/workflows/on-push.yaml @@ -0,0 +1,40 @@ +name: on-push + +on: + push: + tags-ignore: + - release + branches: + - '**' + +jobs: + infra/docker: + runs-on: linux + container: alpine:latest + steps: + - name: Prepare + run: | + export PACKAGE_HOST="$(echo $GITHUB_SERVER_URL | sed s#https://##g)" + echo "PACKAGE_HOST=$PACKAGE_HOST" >> $GITHUB_ENV + export "PACKAGE_IMAGE=$PACKAGE_HOST/$GITHUB_REPOSITORY_OWNER/infra/docker" + echo "PACKAGE_IMAGE=$PACKAGE_IMAGE" >> $GITHUB_ENV + - name: Prepare environment + run: | + apk add git docker + - name: Configure repository access + run: | + git config --global http.$GITHUB_SERVER_URL/.extraheader "Authorization: token ${{ secrets.ACT_RUNNER_TOKEN }}" + - name: Fetch repository + run: | + git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git . + git checkout "$GITHUB_SHA" + - name: Build image + run: | + docker build -t "$PACKAGE_IMAGE:$GITHUB_SHA" ./docker + - name: Test image + run: | + docker run --rm "$PACKAGE_IMAGE:$GITHUB_SHA" docker --version + - name: Push image + run: | + echo ${{ secrets.ACT_RUNNER_TOKEN }} | docker login -u "oauth2" --password-stdin "$PACKAGE_HOST" + docker push "$PACKAGE_IMAGE:$GITHUB_SHA" diff --git a/.gitea/workflows/on-release.yaml b/.gitea/workflows/on-release.yaml new file mode 100644 index 0000000..40ff0b0 --- /dev/null +++ b/.gitea/workflows/on-release.yaml @@ -0,0 +1,40 @@ +name: on-release + +on: + push: + branches-ignore: + - '**' + tags: + - release + +jobs: + infra/docker: + runs-on: linux + container: alpine:latest + steps: + - name: Prepare + run: | + export PACKAGE_HOST="$(echo $GITHUB_SERVER_URL | sed s#https://##g)" + echo "PACKAGE_HOST=$PACKAGE_HOST" >> $GITHUB_ENV + export "PACKAGE_IMAGE=$PACKAGE_HOST/$GITHUB_REPOSITORY_OWNER/infra/docker" + echo "PACKAGE_IMAGE=$PACKAGE_IMAGE" >> $GITHUB_ENV + - name: Prepare environment + run: | + apk add git docker + - name: Configure repository access + run: | + git config --global http.$GITHUB_SERVER_URL/.extraheader "Authorization: token ${{ secrets.ACT_RUNNER_TOKEN }}" + - name: Fetch repository + run: | + git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git . + git checkout "$GITHUB_SHA" + - name: Build image + run: | + docker build -t "$PACKAGE_IMAGE:latest" ./docker + - name: Test image + run: | + docker run --rm "$PACKAGE_IMAGE:latest" docker --version + - name: Push image + run: | + echo ${{ secrets.ACT_RUNNER_TOKEN }} | docker login -u "oauth2" --password-stdin "$PACKAGE_HOST" + docker push "$PACKAGE_IMAGE:latest" diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..e476a76 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,2 @@ +FROM alpine:latest +RUN apk add docker git