From 13c259873d658e23ab3d664e89db0aa20fda015c Mon Sep 17 00:00:00 2001 From: casjay Date: Thu, 4 Jun 2026 16:26:51 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Add=20Gitea=20Actions=20workflow?= =?UTF-8?q?=20files=20=F0=9F=94=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generate .gitea/workflows/build*.yml from updated actions.template: latest build uses yymm + latest tags (latest pushed last); versioned builds hardcode the version tag. ?? .gitea/ .env.scripts .gitea/ --- .env.scripts | 30 +++++++------- .gitea/workflows/build.yml | 84 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 16 deletions(-) create mode 100644 .gitea/workflows/build.yml diff --git a/.env.scripts b/.env.scripts index ddded39..ed0313a 100644 --- a/.env.scripts +++ b/.env.scripts @@ -1,10 +1,10 @@ # - - - - - - - - - - - - - - - - - - - - - - - - - -##@Version : 202601292017-git +##@Version : 202606041625-git # @@Author : CasjaysDev # @@Contact : CasjaysDev -# @@License : MIT +# @@License : WTFPL # @@Copyright : Copyright 2026 CasjaysDev -# @@Created : Thu Jan 29 08:17:11 PM EST 2026 +# @@Created : Thu Jun 4 04:25:54 PM EDT 2026 # @@File : .env.scripts # @@Description : Variables for gen-dockerfile and buildx scripts # @@Changelog : newScript @@ -25,11 +25,12 @@ DOCKER_ENTYPOINT_HEALTH_ENDPOINTS="$DOCKER_ENTYPOINT_HEALTH_ENDPOINTS" # - - - - - - - - - - - - - - - - - - - - - - - - - # Dockerfile info ENV_DOCKERFILE="Dockerfile" -ENV_IMAGE_NAME="web" +# ENV_REGISTRY_REPO: Registry repository/image name +ENV_REGISTRY_REPO="web" ENV_USE_TEMPLATE="alpine" # - - - - - - - - - - - - - - - - - - - - - - - - - # Maintainer info -ENV_ORG_NAME="casjaysdevdocker" +ENV_REGISTRY_ORG="casjaysdevdocker" ENV_VENDOR="CasjaysDev" ENV_AUTHOR="CasjaysDev" ENV_MAINTAINER="CasjaysDev " @@ -37,12 +38,12 @@ ENV_MAINTAINER="CasjaysDev " # Repository URLs (Full URLs) # ENV_GIT_REPO_URL: Complete Git repository URL for source code ENV_GIT_REPO_URL="https://github.com/dockersrc/web" -# ENV_REGISTRY_URL: Complete registry URL for reference (NOT used for pushing) -ENV_REGISTRY_URL="https://hub.docker.com/casjaysdev/web" +# ENV_REGISTRY_URL: Registry provider base URL (for example https://docker.io) +ENV_REGISTRY_URL="https://docker.io" # - - - - - - - - - - - - - - - - - - - - - - - - - # Push Configuration -# ENV_IMAGE_PUSH: Complete push destination (this IS used for pushing) -ENV_IMAGE_PUSH="casjaysdev/web" +# ENV_REGISTRY_PUSH: Complete push destination derived from registry/org/repo +ENV_REGISTRY_PUSH="casjaysdev/web" # ENV_IMAGE_TAG: Default tag for the image ENV_IMAGE_TAG="latest" # ENV_ADD_TAGS: Additional tags, comma-separated (USE_DATE = auto date tag) @@ -53,9 +54,9 @@ ENV_ADD_IMAGE_PUSH="" # - - - - - - - - - - - - - - - - - - - - - - - - - # Pull Configuration # ENV_PULL_URL: Source image to pull from (base image) -ENV_PULL_URL="linuxserver/webtop" +ENV_PULL_URL="casjaysdev/alpine" # ENV_DISTRO_TAG: Tag for the pull source image -ENV_DISTRO_TAG="arch-i3" +ENV_DISTRO_TAG="${IMAGE_VERSION}" # - - - - - - - - - - - - - - - - - - - - - - - - - # Env SERVICE_PORT="" @@ -71,12 +72,9 @@ NODE_MANAGER="system" # - - - - - - - - - - - - - - - - - - - - - - - - - # Default directories WWW_ROOT_DIR="/usr/local/share/httpd/default" -DEFAULT_FILE_DIR="/usr/local/share/template-files" -DEFAULT_DATA_DIR="/usr/local/share/template-files/data" -DEFAULT_CONF_DIR="/usr/local/share/template-files/config" -DEFAULT_TEMPLATE_DIR="/usr/local/share/template-files/defaults" # - - - - - - - - - - - - - - - - - - - - - - - - - -ENV_PACKAGES="bash curl wget procps xfce4 xfce4-goodies xfce4-terminal xfce4-screensaver xfce4-notifyd xfce4-power-manager xfce4-settings xfce4-session xfce4-panel xfce4-whiskermenu-plugin thunar thunar-volman thunar-archive-plugin file-roller gvfs mousepad ristretto parole network-manager-applet firefox evince man-db man-pages xdg-utils xdg-user-dirs pavucontrol ttf-dejavu ttf-liberation noto-fonts noto-fonts-emoji p7zip neofetch which base-devel git sudo" +ENV_PACKAGES="" # - - - - - - - - - - - - - - - - - - - - - - - - - # ex: ts=2 sw=2 et filetype=sh # - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..a4c0bfe --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,84 @@ +name: Build and Push + +on: + push: + branches: [main] + schedule: + - cron: '0 2 1 * *' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 + + - name: Compute build metadata + id: meta + run: | + echo "build_date=$(date -u +%Y%m%d%H%M)" >> "$GITHUB_OUTPUT" + echo "tag_yymm=$(date -u +%y%m)" >> "$GITHUB_OUTPUT" + echo "git_commit=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT" + echo "registry_host=$(echo '${{ github.server_url }}' | sed 's|https://||')" >> "$GITHUB_OUTPUT" + + # ── Always: login to Gitea (GITEA_TOKEN is auto-provided) ──────────────── + - name: Login to Gitea registry + uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 + with: + registry: ${{ steps.meta.outputs.registry_host }} + username: ${{ github.repository_owner }} + password: ${{ secrets.GITEA_TOKEN }} + + # ── Optional: login to Docker Hub when vars.DOCKER_USERNAME is configured ─ + # Login uses vars.DOCKER_USERNAME; secrets.DOCKER_PASSWORD is passed only + # via with: and never touches a shell. + - name: Login to Docker Hub + if: vars.DOCKER_USERNAME != '' + uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 + with: + username: ${{ vars.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + # ── Build once, push to all logged-in registries ───────────────────────── + # Image namespace uses vars.DOCKER_ORG when set, falls back to vars.DOCKER_USERNAME. + # yymm tag pushed first; latest pushed last so registries show :latest as current. + - name: Build and push + uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ${{ steps.meta.outputs.registry_host }}/${{ github.repository }}:${{ steps.meta.outputs.tag_yymm }} + ${{ vars.DOCKER_USERNAME != '' && format('{0}/{1}:{2}', vars.DOCKER_ORG || vars.DOCKER_USERNAME, github.event.repository.name, steps.meta.outputs.tag_yymm) || '' }} + ${{ steps.meta.outputs.registry_host }}/${{ github.repository }}:latest + ${{ vars.DOCKER_USERNAME != '' && format('{0}/{1}:{2}', vars.DOCKER_ORG || vars.DOCKER_USERNAME, github.event.repository.name, 'latest') || '' }} + build-args: | + BUILD_DATE=${{ steps.meta.outputs.build_date }} + GIT_COMMIT=${{ steps.meta.outputs.git_commit }} + BUILD_VERSION=${{ steps.meta.outputs.tag_yymm }} + annotations: | + org.opencontainers.image.created=${{ steps.meta.outputs.build_date }} + org.opencontainers.image.version=latest + org.opencontainers.image.revision=${{ steps.meta.outputs.git_commit }} + org.opencontainers.image.title=${{ github.event.repository.name }} + org.opencontainers.image.description=Containerized version of ${{ github.event.repository.name }} + org.opencontainers.image.vendor=CasjaysDev + org.opencontainers.image.authors=CasjaysDev + org.opencontainers.image.licenses=WTFPL + org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }} + org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} + org.opencontainers.image.documentation=${{ github.server_url }}/${{ github.repository }} + org.opencontainers.image.vcs-type=Git + com.github.containers.toolbox=false