aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorBobby <[email protected]>2024-09-13 22:54:53 -0400
committerBobby <[email protected]>2024-09-13 22:54:53 -0400
commitf3018e8e25c7ce2662676038dcfec4fc1a791993 (patch)
treebd3af1fe755a928f61da4ac283742bb51df9f447 /.github
parent19d80c83da876f995f2e7021929515a5ddbfeefe (diff)
downloadyugen-f3018e8e25c7ce2662676038dcfec4fc1a791993.tar.xz
yugen-f3018e8e25c7ce2662676038dcfec4fc1a791993.zip
Dockerfile deployment
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build.yml40
1 files changed, 40 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..d24e3d7
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,40 @@
+name: Build and Deploy Docker Image
+
+on: [pull_request]
+
+jobs:
+ build_and_deploy:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v4
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+
+ - name: Login to Container Registry
+ uses: docker/login-action@v3
+ with:
+ registry: ghcr.io
+ username: ${{ github.repository_owner }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Preset Image Name
+ run: echo "IMAGE_URL=$(echo ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:$(echo ${{ github.sha }} | cut -c1-7) | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
+
+ - name: Build and push Docker Image
+ uses: docker/build-push-action@v5
+ with:
+ context: .
+ file: ./Dockerfile
+ push: true
+ tags: ${{ env.IMAGE_URL }}
+
+ - name: Deploy Image to CapRrover
+ uses: caprover/[email protected]
+ with:
+ server: "${{ secrets.CAPROVER_SERVER }}"
+ app: "${{ secrets.APP_NAME }}"
+ token: "${{ secrets.APP_TOKEN }}"
+ image: ${{ env.IMAGE_URL }} \ No newline at end of file