diff --git a/.dockerignore b/.dockerignore index 4db2a3c..ee63c18 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,6 +6,7 @@ glb data .git .gitignore +.forgejo .env *.log .DS_Store diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 0000000..cdf37e9 --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -0,0 +1,28 @@ +name: build-and-push + +on: + push: + branches: [main] + tags: ['v*'] + +permissions: + contents: read + packages: write + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Log in to the Forgejo container registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login git.plexultra.com -u "${{ github.actor }}" --password-stdin + + - name: Build and push image + run: | + IMAGE="git.plexultra.com/${{ github.repository }}" + SHA="${{ github.sha }}" + docker build -t "$IMAGE:latest" -t "$IMAGE:${SHA:0:12}" . + docker push "$IMAGE:latest" + docker push "$IMAGE:${SHA:0:12}" diff --git a/docker-compose.yml b/docker-compose.yml index 6c5a3fb..aefc7c8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,7 @@ services: app: build: . - image: ghcr.io/dlawler489/printhive:latest + image: git.plexultra.com/dlawler489/printhive:latest depends_on: db: condition: service_healthy