From 7eed6660aef9731c835bbd807459c4aeb4ee3433 Mon Sep 17 00:00:00 2001 From: evann Date: Thu, 20 Jul 2023 22:51:00 +0200 Subject: [PATCH 1/5] Test Webhook auto-deploy --- .github/workflows/main.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c07f03..d23ec7e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,17 +4,28 @@ on: push: branches: - master + - action-test env: DOCKER_REGISTRY: r.evannregnault.dev DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + PORTAINER_API_KEY: ${{ secrets.PORTAINER_API_KEY }} + PORTAINER_API_WEBHOOK: ${{ secrets.PORTAINER_API_WEBHOOK }} jobs: build_and_push: runs-on: ubuntu-latest steps: + + - name: HTTP Request Action + uses: fjogeleit/http-request-action@v1.14.1 + with: + url: ${{ env.PORTAINER_API_WEBHOOK }} + method: 'POST' + customHeaders: '{"X-API-Key": "' + ${{secrets.PORTAINER_API_KEY}} + '"}' + - name: Checkout repository uses: actions/checkout@v2 From ad1f1a4c5c71576a301fef11a72442b4b6ed2bee Mon Sep 17 00:00:00 2001 From: evann Date: Thu, 20 Jul 2023 22:52:13 +0200 Subject: [PATCH 2/5] Test Webhook auto-deploy --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d23ec7e..7f4554c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: HTTP Request Action uses: fjogeleit/http-request-action@v1.14.1 with: From 8d2856ee555722399fb692e8e25bb042a6b1d97e Mon Sep 17 00:00:00 2001 From: evann Date: Thu, 20 Jul 2023 22:57:02 +0200 Subject: [PATCH 3/5] secret test --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7f4554c..76f250d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: with: url: ${{ env.PORTAINER_API_WEBHOOK }} method: 'POST' - customHeaders: '{"X-API-Key": "' + ${{secrets.PORTAINER_API_KEY}} + '"}' + customHeaders: format('{"X-API-Key": "{0}"', ${{secrets.PORTAINER_API_KEY}}) - name: Checkout repository uses: actions/checkout@v2 From 76fa4bd703eb0bb74c9a03a3e8262a365c8b8e91 Mon Sep 17 00:00:00 2001 From: evann Date: Thu, 20 Jul 2023 22:59:47 +0200 Subject: [PATCH 4/5] Other test --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 76f250d..f825513 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: with: url: ${{ env.PORTAINER_API_WEBHOOK }} method: 'POST' - customHeaders: format('{"X-API-Key": "{0}"', ${{secrets.PORTAINER_API_KEY}}) + customHeaders: ${{ env.PORTAINER_API_KEY }} - name: Checkout repository uses: actions/checkout@v2 From 97e9d99ae4dc5e8a2d34273d5bd14ff431804be1 Mon Sep 17 00:00:00 2001 From: evann Date: Thu, 20 Jul 2023 23:02:50 +0200 Subject: [PATCH 5/5] Other test --- .github/workflows/main.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f825513..b6f4175 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,13 +18,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: HTTP Request Action - uses: fjogeleit/http-request-action@v1.14.1 - with: - url: ${{ env.PORTAINER_API_WEBHOOK }} - method: 'POST' - customHeaders: ${{ env.PORTAINER_API_KEY }} - - name: Checkout repository uses: actions/checkout@v2 @@ -52,4 +45,11 @@ jobs: push: true tags: | ${{ env.DOCKER_REGISTRY }}/obsessed-yanqing:latest - ${{ env.DOCKER_REGISTRY }}/obsessed-yanqing:${{ env.VERSION }} \ No newline at end of file + ${{ env.DOCKER_REGISTRY }}/obsessed-yanqing:${{ env.VERSION }} + + - name: Deploy to production + uses: fjogeleit/http-request-action@v1.14.1 + with: + url: ${{ env.PORTAINER_API_WEBHOOK }} + method: 'POST' + customHeaders: ${{ env.PORTAINER_API_KEY }} \ No newline at end of file