Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
SrIzan10 committed Dec 9, 2023
1 parent aa2ed4e commit 15d2f07
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish to Docker Hub

on:
push:
branches:
- "main"

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/#-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Get latest version
run: |
curl -s https://api.github.com/repos/pocketbase/pocketbase/releases/latest \
| grep "tag_name" \
| awk '{print $2}' \
| tr -d '"' \
| tr -d ',' \
| tr -d 'v' \
| tr -d ' ' \
>> $VERSION
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
sernhandler/pocketbase:latest
sernhandler/pocketbase:$VERSION
build-args: |
VERSION=$VERSION
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
FROM alpine:latest AS download

ARG VERSION
ADD https://github.com/pocketbase/pocketbase/releases/download/v${VERSION}/pocketbase_${VERSION}_linux_amd64.zip /pb.zip
ARG BUILDARCH

ADD https://github.com/pocketbase/pocketbase/releases/download/v${VERSION}/pocketbase_${VERSION}_linux_${BUILDARCH}.zip /pb.zip
RUN unzip /pb.zip && chmod +x /pocketbase

FROM alpine
Expand Down

0 comments on commit 15d2f07

Please # to comment.