diff --git a/.github/workflows/amd64-docker-build.yml b/.github/workflows/amd64-docker-build.yml new file mode 100644 index 0000000000..45c0fbaa31 --- /dev/null +++ b/.github/workflows/amd64-docker-build.yml @@ -0,0 +1,43 @@ +name: "amd64-docker-build" + +on: + push: + branches: + - "**" + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + docker-build: + runs-on: "ubuntu-latest" + permissions: + contents: write + packages: write + steps: + - uses: "actions/checkout@v3" + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=sha + type=semver,pattern={{version}} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to GHCR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v3 + with: + platforms: linux/amd64 + push: true + tags: ${{ steps.meta.outputs.tags }} + file: Dockerfile diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml deleted file mode 100644 index 2a1b5393b7..0000000000 --- a/.github/workflows/docker-build.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: "docker-build" - -on: - push: - tags: - - "v[0-9]+.[0-9]+.[0-9]+" - - "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+" - - "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+" - - "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" - workflow_dispatch: - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - docker-build: - runs-on: "ubuntu-latest" - permissions: - contents: write - packages: write - steps: - - name: "Checkout source code" - uses: "actions/checkout@v3" - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: 1.18 - - name: "Build" - run: "make build" - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Login to GHCR - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: tag version - uses: nowsprinting/check-version-format-action@v3 - id: tag_version - with: - prefix: "v" - - - name: Build and push - uses: docker/build-push-action@v3 - with: - push: true - # yamllint disable - tags: | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag_version.outputs.full }} - # yamllint enable - file: Dockerfile - - docker-build-ephemeral: - runs-on: "ubuntu-latest" - permissions: - contents: write - packages: write - steps: - - name: "Checkout source code" - uses: "actions/checkout@v3" - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: 1.18 - - name: "Build" - run: "make build" - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Login to GHCR - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v3 - with: - push: true - tags: ghcr.io/celestiaorg/celestia-app-ephemeral:latest - file: docker/Dockerfile_ephemeral diff --git a/.github/workflows/main-docker-build.yml b/.github/workflows/main-docker-build.yml new file mode 100644 index 0000000000..726087646b --- /dev/null +++ b/.github/workflows/main-docker-build.yml @@ -0,0 +1,45 @@ +name: "main-docker-build" + +on: + push: + branches: + - main + tags: + - "v*" + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + docker-build: + runs-on: "ubuntu-latest" + permissions: + contents: write + packages: write + steps: + - uses: "actions/checkout@v3" + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=sha + type=semver,pattern={{version}} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to GHCR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v3 + with: + platforms: linux/arm64, linux/amd64 + push: true + tags: ${{ steps.meta.outputs.tags }} + file: Dockerfile