chore: use embed for locales #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| env: | |
| REGISTRY_IMAGE: ghcr.io/ether/etherpad-go | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: 1.25 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: 'npm' | |
| cache-dependency-path: ./ui/package-lock.json | |
| - name: Install dependencies | |
| run: npm install | |
| working-directory: ./ui | |
| - name: Build | |
| run: npm run build | |
| working-directory: ./ui | |
| - name: Install dependencies | |
| run: go mod download | |
| - name: Install templ | |
| run: go install github.com/a-h/templ/cmd/templ@latest | |
| - name: Generate templ | |
| run: templ generate | |
| - name: Set up Docker | |
| uses: docker/setup-docker-action@v4 | |
| - name: Test | |
| run: go test ./... || exit 0 | |
| build: | |
| if: github.ref == 'refs/heads/main' | |
| needs: | |
| - test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: linux/amd64 | |
| runs-on: ubuntu-latest | |
| #- platform: linux/arm64 | |
| # runs-on: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runs-on }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-tags: 'true' | |
| fetch-depth: '0' | |
| - name: Prepare | |
| run: | | |
| platform=${{ matrix.platform }} | |
| echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY_IMAGE }} | |
| - name: Login to Github Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push by digest | |
| id: build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| platforms: ${{ matrix.platform }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| tags: ${{ env.REGISTRY_IMAGE }} | |
| outputs: type=image,push-by-digest=true,name-canonical=true,push=true | |
| - name: Export digest | |
| run: | | |
| mkdir -p ${{ runner.temp }}/digests | |
| digest="${{ steps.build.outputs.digest }}" | |
| touch "${{ runner.temp }}/digests/${digest#sha256:}" | |
| - name: Upload digest | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: digests-${{ env.PLATFORM_PAIR }} | |
| path: ${{ runner.temp }}/digests/* | |
| if-no-files-found: error | |
| retention-days: 1 | |
| merge: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| needs: | |
| - build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-tags: 'true' | |
| fetch-depth: '0' | |
| - name: Download digests | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ${{ runner.temp }}/digests | |
| pattern: digests-* | |
| merge-multiple: true | |
| - name: Login to Github Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY_IMAGE }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| - name: Get last tag and commit hash | |
| id: vars | |
| run: | | |
| TAG=$(git describe --tags --abbrev=0) | |
| HASH=$(git rev-parse --short HEAD) | |
| echo "IMAGE_TAG=${TAG}-${HASH}" >> $GITHUB_ENV | |
| - name: Create manifest list and push | |
| working-directory: ${{ runner.temp }}/digests | |
| run: | | |
| DIGEST_FLAGS=$(for f in *; do printf '%s@sha256:%s ' "$REGISTRY_IMAGE" "$f"; done) | |
| docker buildx imagetools create -t $REGISTRY_IMAGE:$IMAGE_TAG $DIGEST_FLAGS | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| path: ether-charts | |
| repository: ether/ether-charts | |
| token: ${{ secrets.ETHER_CHART_TOKEN }} | |
| - name: Change argocd tag | |
| run: | | |
| cd ether-charts | |
| sed -i "s|tag: .*|tag: \"${{ env.IMAGE_TAG }}\"|g" ./values-go.yaml | |
| git config --global user.name 'github-actions' | |
| git config --global user.email 'noreply@github.com' | |
| git add . | |
| git commit -m "chore: bump etherpad-go image to ${{ env.IMAGE_TAG }}" | |
| git push origin main | |