diff --git a/.gitea/workflows/test_and_build.yml b/.gitea/workflows/test_and_build.yml new file mode 100644 index 0000000..aa57bb0 --- /dev/null +++ b/.gitea/workflows/test_and_build.yml @@ -0,0 +1,48 @@ +name: Build, Test and Register Docker Images + +on: + push: + branches: + - main + - production + pull_request: + types: [closed] + branches: + - production + +jobs: + build-publish-frontend: + runs-on: coc + container: + image: docker + steps: + - name: Login to Registry + uses: docker/login-action@v3 + with: + registry: cocgit.scalingdone.com + username: ${{ secrets.RUNNER_REGISTRY_USERNAME }} + password: ${{ secrets.RUNNER_REGISTRY_PASSWORD }} + + - name: Build Docker image + uses: docker/build-push-action@v6 + with: + context: "{{defaultContext}}:test" + tags: | + cocgit.scalingdone.com/jat/branchingtest/appimage:latest + ${{ github.ref == 'refs/heads/production' && format('cocgit.scalingdone.com/jat/branchingtest/appimage:{0}', github.sha) || '' }} + push: true + + reload-staging: + if: github.ref == 'refs/heads/production' + runs-on: coc + container: + image: curlimages/curl + networks: + - coc + needs: + - build-publish-frontend + steps: + - name: Trigger Watchtower to reload docker image + run: | + echo "hi" + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b09b037 --- /dev/null +++ b/Dockerfile @@ -0,0 +1 @@ +FROM alpine:latest