diff --git a/.github/workflows/build-and-push-on-tags.yml b/.github/workflows/build-latest.yml similarity index 50% rename from .github/workflows/build-and-push-on-tags.yml rename to .github/workflows/build-latest.yml index aa0001d..46ac472 100644 --- a/.github/workflows/build-and-push-on-tags.yml +++ b/.github/workflows/build-latest.yml @@ -1,42 +1,34 @@ -name: build-and-push-on-tags +name: build-latest on: workflow_dispatch: push: - tags: - - "*" + paths-ignore: + - LICENSE + - docker-compose.yml + # branches: + # - main jobs: build-push-latest: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Get version from Dockerfile - id: version_provider - run: | - VERSION=$(grep 'ARG BASE_VERSION' Dockerfile | awk -F= '{print $2}') - echo "::set-output name=version::$VERSION" - - - name: debug - run: | - echo "::debug:: ${{steps.version_provider.outputs.version}}" + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v1 - if: ${{ github.ref == 'refs/heads/main' }} + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: platforms: linux/amd64,linux/arm64 push: ${{ github.ref == 'refs/heads/main' }} @@ -44,4 +36,11 @@ jobs: dcagatay/emailrelay:latest tags: | dcagatay/emailrelay:latest - dcagatay/emailrelay:${{steps.version_provider.outputs.version}} + + - name: Update repo description + uses: peter-evans/dockerhub-description@v4 + if: ${{ github.ref == 'refs/heads/main' }} + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: dcagatay/emailrelay diff --git a/.github/workflows/build-tags.yml b/.github/workflows/build-tags.yml new file mode 100644 index 0000000..1d4377f --- /dev/null +++ b/.github/workflows/build-tags.yml @@ -0,0 +1,35 @@ +name: build-tags +on: + workflow_dispatch: + push: + tags: + - "*" + +jobs: + build-push-tags: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + platforms: linux/amd64,linux/arm64 + push: true + cache-from: | + dcagatay/emailrelay:latest + tags: | + dcagatay/emailrelay:${{ github.ref_name }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 6de6307..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: build-latest -on: - workflow_dispatch: - push: - paths-ignore: - - LICENSE - - docker-compose.yml - # branches: - # - main - -jobs: - build-push-latest: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build - uses: docker/build-push-action@v3 - with: - platforms: linux/amd64,linux/arm64 - push: false - cache-from: | - dcagatay/emailrelay:latest - tags: | - dcagatay/emailrelay:latest diff --git a/.github/workflows/update-docker-hub-readme.yml b/.github/workflows/update-docker-hub-readme.yml deleted file mode 100644 index f3b1ce5..0000000 --- a/.github/workflows/update-docker-hub-readme.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: update-docker-hubs-readme -on: - workflow_dispatch: - push: - paths-ignore: - - LICENSE - - docker-compose.yml - branches: - - main - -jobs: - build-push-latest: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Update Docker Hub Description - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - repository: dcagatay/emailrelay