[mirror] Command-line application for uploading a site to a git-pages server

Compare changes

Choose any two refs to compare.

+19 -24
.forgejo/workflows/ci.yaml
··· 7 7 8 8 jobs: 9 9 check: 10 - runs-on: codeberg-small-lazy 10 + runs-on: debian-trixie 11 11 container: 12 - image: docker.io/library/node:24-trixie-slim@sha256:fcdfd7bcd8f641c8c76a8950343c73912d68ba341e8dd1074e663b784d3e76f4 12 + image: docker.io/library/node:24-trixie-slim@sha256:b05474903f463ce4064c09986525e6588c3e66c51b69be9c93a39fb359f883ce 13 13 steps: 14 14 - name: Check out source code 15 - uses: https://code.forgejo.org/actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 15 + uses: https://code.forgejo.org/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 16 16 - name: Set up toolchain 17 17 uses: https://code.forgejo.org/actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 18 18 with: ··· 34 34 # IMPORTANT: This workflow step will not work without the Releases unit enabled! 35 35 if: ${{ forge.ref == 'refs/heads/main' || startsWith(forge.event.ref, 'refs/tags/v') }} 36 36 needs: [check] 37 - runs-on: codeberg-small-lazy 37 + runs-on: debian-trixie 38 38 container: 39 - image: docker.io/library/node:24-trixie-slim@sha256:fcdfd7bcd8f641c8c76a8950343c73912d68ba341e8dd1074e663b784d3e76f4 39 + image: docker.io/library/node:24-trixie-slim@sha256:b05474903f463ce4064c09986525e6588c3e66c51b69be9c93a39fb359f883ce 40 40 steps: 41 41 - name: Check out source code 42 - uses: https://code.forgejo.org/actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 42 + uses: https://code.forgejo.org/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 43 43 - name: Set up toolchain 44 44 uses: https://code.forgejo.org/actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 45 45 with: ··· 70 70 package: 71 71 if: ${{ forge.ref == 'refs/heads/main' || startsWith(forge.event.ref, 'refs/tags/v') }} 72 72 needs: [check] 73 - runs-on: codeberg-small-lazy 73 + runs-on: debian-trixie 74 74 container: 75 - image: docker.io/library/node:24-trixie-slim@sha256:fcdfd7bcd8f641c8c76a8950343c73912d68ba341e8dd1074e663b784d3e76f4 75 + image: docker.io/library/node:24-trixie-slim@sha256:b05474903f463ce4064c09986525e6588c3e66c51b69be9c93a39fb359f883ce 76 76 steps: 77 77 - name: Install dependencies 78 78 run: | 79 79 apt-get -y update 80 - apt-get -y install buildah ca-certificates 80 + apt-get -y install ca-certificates buildah qemu-user-binfmt 81 81 - name: Check out source code 82 - uses: https://code.forgejo.org/actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 82 + uses: https://code.forgejo.org/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 83 83 - name: Build container 84 84 run: | 85 85 printf '[storage]\ndriver="vfs"\nrunroot="/run/containers/storage"\ngraphroot="/var/lib/containers/storage"\n' | tee /etc/containers/storage.conf 86 - buildah build --arch=amd64 --tag=container:${VER}-amd64 . 87 - buildah build --arch=arm64 --tag=container:${VER}-arm64 . 88 - buildah manifest create container:${VER} \ 89 - container:${VER}-amd64 \ 90 - container:${VER}-arm64 86 + buildah build --arch=amd64 --tag=container:amd64 87 + buildah build --arch=arm64 --tag=container:arm64 88 + buildah manifest create container container:amd64 container:arm64 91 89 env: 92 90 BUILDAH_ISOLATION: chroot 93 - VER: ${{ startsWith(forge.event.ref, 'refs/tags/v') && forge.ref_name || 'latest' }} 94 91 - if: ${{ forge.repository == 'git-pages/git-pages-cli' }} 95 92 name: Push container to Codeberg 96 93 run: | 97 - buildah login --authfile=/tmp/authfile-${FORGE}.json \ 94 + buildah login --authfile=/tmp/authfile.json \ 98 95 -u ${{ vars.PACKAGES_USER }} -p ${{ secrets.PACKAGES_TOKEN }} ${FORGE} 99 - buildah manifest push --authfile=/tmp/authfile-${FORGE}.json \ 100 - --all container:${VER} "docker://${FORGE}/${{ forge.repository }}:${VER/v/}" 96 + buildah manifest push --authfile=/tmp/authfile.json \ 97 + --all container "docker://${FORGE}/${{ forge.repository }}:${VER/v/}" 101 98 env: 102 - BUILDAH_ISOLATION: chroot 103 99 FORGE: codeberg.org 104 100 VER: ${{ startsWith(forge.event.ref, 'refs/tags/v') && forge.ref_name || 'latest' }} 105 101 - if: ${{ forge.repository == 'git-pages/git-pages-cli' }} 106 102 name: Push container to code.forgejo.org 107 103 run: | 108 - buildah login --authfile=/tmp/authfile-${FORGE}.json \ 104 + buildah login --authfile=/tmp/authfile.json \ 109 105 -u ${{ vars.PACKAGES_USER }} -p ${{ secrets.CFO_PACKAGES_TOKEN }} ${FORGE} 110 - buildah manifest push --authfile=/tmp/authfile-${FORGE}.json \ 111 - --all container:${VER} "docker://${FORGE}/${{ forge.repository }}:${VER/v/}" 106 + buildah manifest push --authfile=/tmp/authfile.json \ 107 + --all container "docker://${FORGE}/${{ forge.repository }}:${VER/v/}" 112 108 env: 113 - BUILDAH_ISOLATION: chroot 114 109 FORGE: code.forgejo.org 115 110 VER: ${{ startsWith(forge.event.ref, 'refs/tags/v') && forge.ref_name || 'latest' }}
+1 -1
Dockerfile
··· 1 - FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.25-alpine@sha256:d3f0cf7723f3429e3f9ed846243970b20a2de7bae6a5b66fc5914e228d831bbb AS builder 1 + FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.25-alpine@sha256:ac09a5f469f307e5da71e766b0bd59c9c49ea460a528cc3e6686513d64a6f1fb AS builder 2 2 ARG TARGETOS TARGETARCH 3 3 RUN apk --no-cache add ca-certificates git 4 4 WORKDIR /build
+24
flake.lock
··· 18 18 "type": "github" 19 19 } 20 20 }, 21 + "gomod2nix": { 22 + "inputs": { 23 + "flake-utils": [ 24 + "flake-utils" 25 + ], 26 + "nixpkgs": [ 27 + "nixpkgs" 28 + ] 29 + }, 30 + "locked": { 31 + "lastModified": 1763982521, 32 + "narHash": "sha256-ur4QIAHwgFc0vXiaxn5No/FuZicxBr2p0gmT54xZkUQ=", 33 + "owner": "nix-community", 34 + "repo": "gomod2nix", 35 + "rev": "02e63a239d6eabd595db56852535992c898eba72", 36 + "type": "github" 37 + }, 38 + "original": { 39 + "owner": "nix-community", 40 + "repo": "gomod2nix", 41 + "type": "github" 42 + } 43 + }, 21 44 "nix-filter": { 22 45 "locked": { 23 46 "lastModified": 1757882181, ··· 52 75 "root": { 53 76 "inputs": { 54 77 "flake-utils": "flake-utils", 78 + "gomod2nix": "gomod2nix", 55 79 "nix-filter": "nix-filter", 56 80 "nixpkgs": "nixpkgs" 57 81 }
+22 -4
flake.nix
··· 3 3 nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 4 4 flake-utils.url = "github:numtide/flake-utils"; 5 5 nix-filter.url = "github:numtide/nix-filter"; 6 + 7 + gomod2nix = { 8 + url = "github:nix-community/gomod2nix"; 9 + inputs.nixpkgs.follows = "nixpkgs"; 10 + inputs.flake-utils.follows = "flake-utils"; 11 + }; 6 12 }; 7 13 8 14 outputs = ··· 11 17 nixpkgs, 12 18 flake-utils, 13 19 nix-filter, 14 - }: 20 + ... 21 + }@inputs: 15 22 flake-utils.lib.eachDefaultSystem ( 16 23 system: 17 24 let 18 - pkgs = nixpkgs.legacyPackages.${system}; 25 + pkgs = import nixpkgs { 26 + inherit system; 19 27 20 - git-pages-cli = pkgs.buildGo125Module { 28 + overlays = [ 29 + inputs.gomod2nix.overlays.default 30 + ]; 31 + }; 32 + 33 + git-pages-cli = pkgs.buildGoApplication { 21 34 pname = "git-pages-cli"; 22 35 version = "0"; 23 36 ··· 41 54 "-s -w" 42 55 ]; 43 56 44 - vendorHash = "sha256-5vjUhN3lCr41q91lOD7v0F9c6a8GJj7wBGnnzgFBhJU="; 57 + go = pkgs.go_1_25; 58 + modules = ./gomod2nix.toml; 45 59 }; 46 60 in 47 61 { ··· 50 64 devShells.default = pkgs.mkShell { 51 65 inputsFrom = [ 52 66 git-pages-cli 67 + ]; 68 + 69 + packages = with pkgs; [ 70 + gomod2nix 53 71 ]; 54 72 }; 55 73
+2 -2
go.mod
··· 3 3 go 1.25.0 4 4 5 5 require ( 6 - github.com/klauspost/compress v1.18.1 7 - github.com/spf13/pflag v1.0.10 8 6 github.com/google/uuid v1.6.0 7 + github.com/klauspost/compress v1.18.2 8 + github.com/spf13/pflag v1.0.10 9 9 )
+2 -2
go.sum
··· 1 1 github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= 2 2 github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 3 - github.com/klauspost/compress v1.18.1 h1:bcSGx7UbpBqMChDtsF28Lw6v/G94LPrrbMbdC3JH2co= 4 - github.com/klauspost/compress v1.18.1/go.mod h1:ZQFFVG+MdnR0P+l6wpXgIL4NTtwiKIdBnrBd8Nrxr+0= 3 + github.com/klauspost/compress v1.18.2 h1:iiPHWW0YrcFgpBYhsA6D1+fqHssJscY/Tm/y2Uqnapk= 4 + github.com/klauspost/compress v1.18.2/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= 5 5 github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= 6 6 github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
+12
gomod2nix.toml
··· 1 + schema = 3 2 + 3 + [mod] 4 + [mod."github.com/google/uuid"] 5 + version = "v1.6.0" 6 + hash = "sha256-VWl9sqUzdOuhW0KzQlv0gwwUQClYkmZwSydHG2sALYw=" 7 + [mod."github.com/klauspost/compress"] 8 + version = "v1.18.2" 9 + hash = "sha256-mRa+6qEi5joqQao13ZFogmq67rOQzHCVbCCjKA+HKEc=" 10 + [mod."github.com/spf13/pflag"] 11 + version = "v1.0.10" 12 + hash = "sha256-uDPnWjHpSrzXr17KEYEA1yAbizfcsfo5AyztY2tS6ZU="
+3 -1
renovate.json
··· 9 9 "lockFileMaintenance": { 10 10 "enabled": true, 11 11 "automerge": false 12 - } 12 + }, 13 + "semanticCommits": "disabled", 14 + "commitMessagePrefix": "[Renovate]" 13 15 }