this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

hepa: dockerfile and github build actions

+143
+52
.github/workflows/container-hepa-aws.yaml
··· 1 + name: container-hepa-aws 2 + on: [push] 3 + env: 4 + REGISTRY: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_REGISTRY }} 5 + USERNAME: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_USERNAME }} 6 + PASSWORD: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_PASSWORD }} 7 + # github.repository as <account>/<repo> 8 + IMAGE_NAME: hepa 9 + 10 + jobs: 11 + container-hepa-aws: 12 + if: github.repository == 'bluesky-social/indigo' 13 + runs-on: ubuntu-latest 14 + permissions: 15 + contents: read 16 + packages: write 17 + id-token: write 18 + 19 + steps: 20 + - name: Checkout repository 21 + uses: actions/checkout@v3 22 + 23 + - name: Setup Docker buildx 24 + uses: docker/setup-buildx-action@v1 25 + 26 + - name: Log into registry ${{ env.REGISTRY }} 27 + uses: docker/login-action@v2 28 + with: 29 + registry: ${{ env.REGISTRY }} 30 + username: ${{ env.USERNAME }} 31 + password: ${{ env.PASSWORD }} 32 + 33 + - name: Extract Docker metadata 34 + id: meta 35 + uses: docker/metadata-action@v4 36 + with: 37 + images: | 38 + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 39 + tags: | 40 + type=sha,enable=true,priority=100,prefix=,suffix=,format=long 41 + 42 + - name: Build and push Docker image 43 + id: build-and-push 44 + uses: docker/build-push-action@v4 45 + with: 46 + context: . 47 + file: ./cmd/hepa/Dockerfile 48 + push: ${{ github.event_name != 'pull_request' }} 49 + tags: ${{ steps.meta.outputs.tags }} 50 + labels: ${{ steps.meta.outputs.labels }} 51 + cache-from: type=gha 52 + cache-to: type=gha,mode=max
+54
.github/workflows/container-hepa-ghcr.yaml
··· 1 + name: container-hepa-ghcr 2 + on: 3 + push: 4 + branches: 5 + - main 6 + - bnewbold/automod 7 + env: 8 + REGISTRY: ghcr.io 9 + # github.repository as <account>/<repo> 10 + IMAGE_NAME: ${{ github.repository }} 11 + 12 + jobs: 13 + container-hepa-ghcr: 14 + if: github.repository == 'bluesky-social/indigo' 15 + runs-on: ubuntu-latest 16 + permissions: 17 + contents: read 18 + packages: write 19 + id-token: write 20 + 21 + steps: 22 + - name: Checkout repository 23 + uses: actions/checkout@v3 24 + 25 + - name: Setup Docker buildx 26 + uses: docker/setup-buildx-action@v1 27 + 28 + - name: Log into registry ${{ env.REGISTRY }} 29 + uses: docker/login-action@v2 30 + with: 31 + registry: ${{ env.REGISTRY }} 32 + username: ${{ github.actor }} 33 + password: ${{ secrets.GITHUB_TOKEN }} 34 + 35 + - name: Extract Docker metadata 36 + id: meta 37 + uses: docker/metadata-action@v4 38 + with: 39 + images: | 40 + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 41 + tags: | 42 + type=sha,enable=true,priority=100,prefix=hepa:,suffix=,format=long 43 + 44 + - name: Build and push Docker image 45 + id: build-and-push 46 + uses: docker/build-push-action@v4 47 + with: 48 + context: . 49 + file: ./cmd/hepa/Dockerfile 50 + push: ${{ github.event_name != 'pull_request' }} 51 + tags: ${{ steps.meta.outputs.tags }} 52 + labels: ${{ steps.meta.outputs.labels }} 53 + cache-from: type=gha 54 + cache-to: type=gha,mode=max
+37
cmd/hepa/Dockerfile
··· 1 + # Run this dockerfile from the top level of the indigo git repository like: 2 + # 3 + # podman build -f ./cmd/hepa/Dockerfile -t hepa . 4 + 5 + ### Compile stage 6 + FROM golang:1.21-alpine3.18 AS build-env 7 + RUN apk add --no-cache build-base make git 8 + 9 + ADD . /dockerbuild 10 + WORKDIR /dockerbuild 11 + 12 + # timezone data for alpine builds 13 + ENV GOEXPERIMENT=loopvar 14 + RUN GIT_VERSION=$(git describe --tags --long --always) && \ 15 + go build -tags timetzdata -o /hepa ./cmd/hepa 16 + 17 + ### Run stage 18 + FROM alpine:3.18 19 + 20 + RUN apk add --no-cache --update dumb-init ca-certificates 21 + ENTRYPOINT ["dumb-init", "--"] 22 + 23 + WORKDIR / 24 + RUN mkdir -p data/hepa 25 + COPY --from=build-env /hepa / 26 + 27 + # small things to make golang binaries work well under alpine 28 + ENV GODEBUG=netdns=go 29 + ENV TZ=Etc/UTC 30 + 31 + EXPOSE 2210 32 + 33 + CMD ["/hepa"] 34 + 35 + LABEL org.opencontainers.image.source=https://github.com/bluesky-social/indigo 36 + LABEL org.opencontainers.image.description="ATP Auto-Moderation Service (hepa)" 37 + LABEL org.opencontainers.image.licenses=MIT