-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Literiver, a mass-sqlite backup tool
- Loading branch information
1 parent
3f7c1d3
commit 68c42f2
Showing
9 changed files
with
1,295 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: container-bigsky-ghcr | ||
on: [push] | ||
env: | ||
REGISTRY: ghcr.io | ||
USERNAME: ${{ github.actor }} | ||
PASSWORD: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# github.repository as <account>/<repo> | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
container-bigsky-ghcr: | ||
if: github.repository == 'bluesky-social/indigo' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ env.USERNAME }} | ||
password: ${{ env.PASSWORD }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=sha,enable=true,priority=100,prefix=literiver:,suffix=,format=long | ||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./cmd/literiver/Dockerfile | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
### Compile stage | ||
FROM golang:1.21-alpine3.18 AS build-env | ||
RUN apk add --no-cache build-base make git | ||
|
||
ADD . /dockerbuild | ||
WORKDIR /dockerbuild | ||
|
||
# timezone data for alpine builds | ||
ENV GOEXPERIMENT=loopvar | ||
RUN GIT_VERSION=$(git describe --tags --long --always) && \ | ||
go build -tags timetzdata -o /literiver ./cmd/literiver | ||
|
||
### Run stage | ||
FROM alpine:3.18 | ||
|
||
RUN apk add --no-cache --update dumb-init ca-certificates | ||
ENTRYPOINT ["dumb-init", "--"] | ||
|
||
WORKDIR / | ||
RUN mkdir -p data/literiver | ||
COPY --from=build-env /literiver / | ||
|
||
# small things to make golang binaries work well under alpine | ||
ENV GODEBUG=netdns=go | ||
ENV TZ=Etc/UTC | ||
|
||
EXPOSE 9032 | ||
|
||
CMD ["/literiver"] | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/bluesky-social/literiver | ||
LABEL org.opencontainers.image.description="Litestream-based Mass SQLite Replicator" | ||
LABEL org.opencontainers.image.licenses=MIT |
Oops, something went wrong.