diff --git a/.github/dependabot b/.github/Dependabot.yml similarity index 100% rename from .github/dependabot rename to .github/Dependabot.yml diff --git a/.github/workflows/pr-docker-build.yml b/.github/workflows/pr-docker-build.yml new file mode 100644 index 00000000..50bba361 --- /dev/null +++ b/.github/workflows/pr-docker-build.yml @@ -0,0 +1,30 @@ +name: Build and Publish PR Docker Image + +on: + pull_request: + types: [opened, synchronize] + +jobs: + build-and-publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + + - name: Set image tag + id: vars + run: echo "IMAGE_TAG=ghcr.io/gitroomhq/postiz-app-pr:${{ github.event.pull_request.number }}" >> $GITHUB_ENV + + - name: Build Docker image from Dockerfile.dev + run: docker build -f Dockerfile.dev -t $IMAGE_TAG . + + - name: Push Docker image to GHCR + run: docker push $IMAGE_TAG diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f3a269ee..19fec3db 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,7 +44,7 @@ This project follows a Fork/Feature Branch/Pull Request model. If you're not fam ```bash git push -u origin feature/your-feature-name ``` -9. **Create a pull request**: Propose your changes **to the dev branch**. +9. **Create a pull request**: Propose your changes **to the main branch**. # Need Help? diff --git a/Jenkinsfile b/Jenkinsfile index 3111f18d..75c1ce0f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,23 +6,6 @@ pipeline { } stages { - stage('Fetch Cache') { - options { - cache(caches: [ - arbitraryFileCache( - cacheName: 'Next', - cacheValidityDecidingFile: '', - excludes: '', - includes: '**/*', - path: "./.nx/cache" - ) - ], defaultBranch: 'dev', maxCacheSize: 256000, skipSave: true) - } - steps { - echo 'Start fetching Cache.' - } - } - stage('Checkout Repository') { steps { checkout scm @@ -55,25 +38,7 @@ pipeline { sh 'npm run build 2>&1 | tee build_report.log' // Captures build output } } - - stage('Save Cache') { - options { - cache(caches: [ - arbitraryFileCache( - cacheName: 'Next', - cacheValidityDecidingFile: '', - excludes: '', - includes: '**/*', - path: "./.nx/cache" - ) - ], defaultBranch: 'dev', maxCacheSize: 256000, skipRestore: true) - } - steps { - echo 'Start saving Cache.' - } - } } - post { always { junit '**/reports/junit.xml'