From b221dfdeb78fd91dc3bae5a8d1fd96e9bdc663f2 Mon Sep 17 00:00:00 2001 From: Wavering Ana Date: Fri, 31 Jan 2025 19:33:04 -0500 Subject: [PATCH] I wish GA was a better CI/CD platform --- .github/workflows/docker-image.yml | 16 ++---- .github/workflows/main.yml | 80 ------------------------------ Dockerfile | 2 +- 3 files changed, 4 insertions(+), 94 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index c38352e..ae099c4 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -59,22 +59,12 @@ jobs: ${{ env.IMAGE_NAME }} ${{ env.REGISTRY }}/${{ github.repository }} - - name: Build and push Docker image (amd64) + - name: Build and push Docker image uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }}-amd64 - labels: ${{ steps.meta.outputs.labels }} - - - name: Build and push Docker image (arm64) - uses: docker/build-push-action@v6 - with: - context: . - file: ./Dockerfile - platforms: linux/arm64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }}-arm64 + tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 621552e..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: Docker - -on: - schedule: - - cron: "38 9 * * *" - push: - branches: ["main"] - tags: ["v*.*.*"] - pull_request: - branches: ["main"] - release: - types: [published] - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - build: - runs-on: macos-latest - permissions: - contents: read - packages: write - id-token: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Install cosign - if: github.event_name != 'pull_request' - uses: sigstore/cosign-installer@v3.7.0 - with: - cosign-release: "v2.4.1" - - - name: Setup Docker buildx - uses: docker/setup-buildx-action@v3 - - - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Log in to Docker Hub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ env.IMAGE_NAME }} - ${{ env.REGISTRY }}/${{ github.repository }} - - - name: Build and push Docker image (amd64) - uses: docker/build-push-action@v6 - with: - context: . - file: ./Dockerfile - platforms: linux/amd64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }}-amd64 - labels: ${{ steps.meta.outputs.labels }} - - - name: Build and push Docker image (arm64) - uses: docker/build-push-action@v6 - with: - context: . - file: ./Dockerfile - platforms: linux/arm64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }}-arm64 - labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index c388602..d508e1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,7 +57,7 @@ COPY --from=backend-builder /usr/src/app/migrations /app/migrations # Copy static files COPY --from=backend-builder /usr/src/app/static /app/static -# Expose the port (this is just documentation) +# Expose the port EXPOSE 8080 # Set default network configuration