mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
chore: add Docker build on PR
This commit is contained in:
parent
438fc345d4
commit
367780cccb
3
.env.production.example
Normal file
3
.env.production.example
Normal file
@ -0,0 +1,3 @@
|
||||
DATABASE_URL="postgres://dokploy:amukds4wi9001583845717ad2@dokploy-postgres:5432/dokploy"
|
||||
PORT=3000
|
||||
NODE_ENV=production
|
55
.github/workflows/pull-request.yml
vendored
55
.github/workflows/pull-request.yml
vendored
@ -5,7 +5,8 @@ on:
|
||||
- main
|
||||
- canary
|
||||
jobs:
|
||||
build:
|
||||
build-app:
|
||||
if: github.event_name == 'pull_request'
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
@ -23,4 +24,54 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
- name: Run Build
|
||||
run: pnpm build
|
||||
run: pnpm build
|
||||
|
||||
|
||||
build-docker-on-pr:
|
||||
if: github.event_name == 'pull_request'
|
||||
needs: build-app
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Prepare .env file
|
||||
run: |
|
||||
cp .env.production.example .env.production
|
||||
|
||||
- name: Run custom Docker build script
|
||||
run: |
|
||||
|
||||
chmod +x ./docker/build.sh
|
||||
echo "Building Docker image for ${{ github.head_ref }}"
|
||||
./docker/build.sh ${{ github.head_ref == 'canary' && 'canary' || '' }}
|
||||
|
||||
build-and-push-docker-on-push:
|
||||
if: github.event_name == 'push'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Prepare .env file
|
||||
run: |
|
||||
cp .env.production.example .env.production
|
||||
|
||||
- name: Build and push Docker image using custom script
|
||||
run: |
|
||||
chmod +x ./docker/build.sh
|
||||
chmod +x ./docker/push.sh
|
||||
./docker/build.sh ${{ github.ref_name == 'canary' && 'canary' || '' }}
|
||||
./docker/push.sh ${{ github.ref_name == 'canary' && 'canary' || '' }}
|
Loading…
Reference in New Issue
Block a user