From ac2dc45a8ec1411bc476c790f0b8fac39d03194a Mon Sep 17 00:00:00 2001 From: sammrai <13623491+sammrai@users.noreply.github.com> Date: Fri, 3 May 2024 17:52:53 +0900 Subject: [PATCH 1/3] add test --- .github/workflows/build-docker-image.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index c3fd6b9..dd84d6c 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -43,3 +43,8 @@ jobs: tags: | ${{ github.repository }}:${{ github.sha }} ${{ github.repository }}:test + + - name: Run tests + run: | + docker pull ${{ github.repository }}:${{ github.sha }} + docker run --rm ${{ github.repository }}:${{ github.sha }} --exchanges kucoin kraken --symbols BTC/USDT ETH/USDT \ No newline at end of file From 3a3acb1254d6261cd36fd331671651d478fdb435 Mon Sep 17 00:00:00 2001 From: sammrai <13623491+sammrai@users.noreply.github.com> Date: Fri, 3 May 2024 17:54:12 +0900 Subject: [PATCH 2/3] add fail test --- .github/workflows/build-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index dd84d6c..611f2b5 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -47,4 +47,4 @@ jobs: - name: Run tests run: | docker pull ${{ github.repository }}:${{ github.sha }} - docker run --rm ${{ github.repository }}:${{ github.sha }} --exchanges kucoin kraken --symbols BTC/USDT ETH/USDT \ No newline at end of file + docker run --rm ${{ github.repository }}:${{ github.sha }} --exchanges kucoina kraken --symbols BTC/USDT ETH/USDT \ No newline at end of file From ef409bf63bd4bff5c0197b7a023add5a9fbe33ff Mon Sep 17 00:00:00 2001 From: sammrai <13623491+sammrai@users.noreply.github.com> Date: Fri, 3 May 2024 18:06:22 +0900 Subject: [PATCH 3/3] add automerge ci --- .github/workflows/build-docker-image.yml | 2 +- .github/workflows/dependabot-automerge.yml | 77 ++++++++++++++++++++++ 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/dependabot-automerge.yml diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 611f2b5..dd84d6c 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -47,4 +47,4 @@ jobs: - name: Run tests run: | docker pull ${{ github.repository }}:${{ github.sha }} - docker run --rm ${{ github.repository }}:${{ github.sha }} --exchanges kucoina kraken --symbols BTC/USDT ETH/USDT \ No newline at end of file + docker run --rm ${{ github.repository }}:${{ github.sha }} --exchanges kucoin kraken --symbols BTC/USDT ETH/USDT \ No newline at end of file diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml new file mode 100644 index 0000000..bca4476 --- /dev/null +++ b/.github/workflows/dependabot-automerge.yml @@ -0,0 +1,77 @@ + +name: Dependabot auto-merge + +on: pull_request + +permissions: + contents: read + + +jobs: + docker-build: + name: Build and test + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' || github.event.action == 'synchronize' && startsWith( github.head_ref, 'dependabot' ) }} + + env: + IMAGE_NAME: ${{ github.repository }} + steps: + - name: checkout + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + if: github.ref == 'refs/heads/main' + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: | + ${{ github.repository }}:${{ github.sha }} + ${{ github.repository }}:latest + + - name: Build and push for test branch + if: github.ref == 'refs/heads/test' + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: | + ${{ github.repository }}:${{ github.sha }} + ${{ github.repository }}:test + + - name: Run tests + run: | + docker pull ${{ github.repository }}:${{ github.sha }} + docker run --rm ${{ github.repository }}:${{ github.sha }} --exchanges kucoin kraken --symbols BTC/USDT ETH/USDT + + dependabot: + runs-on: ubuntu-latest + permissions: write-all + needs: build + if: ${{ github.actor == 'dependabot[bot]' || github.event.action == 'synchronize' && startsWith( github.head_ref, 'dependabot' ) }} + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Approve and enable auto-merge for Dependabot PRs + if: | + ${{ ( steps.metadata.outputs.package-ecosystem == 'hex' && steps.metadata.outputs.update-type == 'version-update:semver-patch' ) || steps.metadata.outputs.package-ecosystem == 'github-actions' }} + run: | + gh pr review --approve "$PR_URL" + gh pr edit "$PR_URL" -t "(auto merged) $PR_TITLE" + gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + PR_TITLE: ${{ github.event.pull_request.title }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}