diff --git a/.github/workflows/dev.docker.yml b/.github/workflows/dev.docker.yml new file mode 100644 index 0000000..46b1410 --- /dev/null +++ b/.github/workflows/dev.docker.yml @@ -0,0 +1,46 @@ +name: Publish API Image (Dev) + +on: + push: + branches: + - dev + +permissions: + contents: read + packages: write + +jobs: + docker-build-push-dev: + runs-on: ubuntu-latest + + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract Docker metadata (Dev) + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/pressiqo-land + tags: | + dev + + - name: Build and push Docker image (Dev) + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + platforms: linux/amd64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/build.yml b/.github/workflows/gh.build.yml similarity index 100% rename from .github/workflows/build.yml rename to .github/workflows/gh.build.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/gh.deploy.yml similarity index 100% rename from .github/workflows/deploy.yml rename to .github/workflows/gh.deploy.yml diff --git a/.github/workflows/main.docker.yml b/.github/workflows/main.docker.yml new file mode 100644 index 0000000..0dca502 --- /dev/null +++ b/.github/workflows/main.docker.yml @@ -0,0 +1,48 @@ +name: Publish API Image + +on: + push: + branches: + - main + tags: + - "v*.*.*" + +permissions: + contents: read + packages: write + +jobs: + docker-build-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/pressiqo-land + tags: | + latest + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + platforms: linux/amd64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5cd9468..78de467 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,33 +1,68 @@ -name: Build Only +name: Release API on: push: branches: - - build + - main + +permissions: + contents: write jobs: - build: + build-and-release: runs-on: ubuntu-latest - + defaults: + run: + shell: bash steps: - - name: Checkout - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v3 + - name: Set up Node.js + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 + cache: npm - name: Install dependencies - run: npm ci --legacy-peer-deps - working-directory: ./app + run: | + if [ -f package-lock.json ]; then + npm ci + else + npm install + fi + + - name: Build production bundle + run: npm run build --if-present - - name: Build - run: npm run build - working-directory: ./app + - name: Compute release tag + id: version + run: echo "tag=v$(date +'%Y.%m.%d')-${GITHUB_RUN_NUMBER}" >> "$GITHUB_OUTPUT" + + - name: Prepare release archive + run: | + mkdir -p release + cp -r dist release/ + cp package.json release/ + [ -f package-lock.json ] && cp package-lock.json release/ + cp tsconfig.json release/ || true + tar -czf pressiqo-land-${{ steps.version.outputs.tag }}.tar.gz -C release . - name: Upload build artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + with: + name: pressiqo-land-${{ steps.version.outputs.tag }} + path: pressiqo-land-${{ steps.version.outputs.tag }}.tar.gz + retention-days: 14 + + - name: Publish GitHub release + uses: softprops/action-gh-release@v2 with: - name: app-dist - path: ./app/dist \ No newline at end of file + tag_name: ${{ steps.version.outputs.tag }} + name: pressiqo.app ${{ steps.version.outputs.tag }} + body: | + Automated release for pressiqo.app + - Commit: ${{ github.sha }} + - Build: ${{ github.run_id }} + files: | + pressiqo-land-${{ steps.version.outputs.tag }}.tar.gz diff --git a/App.tsx b/App.tsx index 7a5fdfb..0fac0f3 100644 --- a/App.tsx +++ b/App.tsx @@ -25,7 +25,7 @@ const App: React.FC = () => { - + {/* */}