From 7ec194a2d10840944f9ef78eb454151ef8b208ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Rudolph=20B=C3=BChrmann=20=40=20S2C=20Consulting?= <89936232+jrb-s2c-github@users.noreply.github.com> Date: Mon, 8 Apr 2024 14:59:18 +0200 Subject: [PATCH] Create deployment action for develop branch --- .github/workflows/main.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..a1d1eeeb --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,37 @@ +# https://docs.docker.com/build/ci/github-actions/push-multi-registries/ +name: docker_push + +on: + workflow_dispatch: + push: + branches: + - "develop" + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to SADiLaR Container Registry + uses: docker/login-action@v3 + with: + registry: docker.sadilar.org + username: ${{ vars.SADILAR_DOCKER_REPOSITORY_USER }} + password: ${{ secrets.SADILAR_DOCKER_REPOSITORY_SECRET }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64 + push: true + tags: | + docker.sadilar.org/term_platform:latest + - name: Use webhook action to start deployment + uses: joelwmale/webhook-action@2.3.2 + with: + url: https://api.bitbucket.org/2.0/repositories/team_sadilar/ansible/pipelines/ + headers: '{"Authorization": "Bearer ${{ secrets.BITBUCKET_PIPELINE_SECRET }}"}' + body: '{"target": {"ref_type": "branch", "type": "pipeline_ref_target", "ref_name": "master", "selector": {"type": "custom", "pattern": "deploy_term_platform" } }}'