diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dd9f21c1f..2f514b985 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,6 +5,7 @@ on: branches: - master - dev + - dev2 pull_request: jobs: @@ -92,6 +93,22 @@ jobs: - run: docker compose -f .github/docker-compose-dev.yml build - run: docker tag ${IMAGE} ${REGISTRY}/${REPO}:dev - run: docker push ${REGISTRY}/${REPO}:dev + docker-dev2: + name: Deploy docker image + if: github.repository == 'goodjoblife/GoodJobShare' && github.event_name == 'push' && github.ref == 'refs/heads/dev2' + runs-on: ubuntu-latest + needs: + - test + env: + REGISTRY: docker.pkg.github.com + REPO: goodjoblife/goodjobshare/web-server-dev + IMAGE: goodjobshare:dev + steps: + - uses: actions/checkout@v4 + - run: docker login ${REGISTRY} -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} + - run: docker compose -f .github/docker-compose-dev.yml build + - run: docker tag ${IMAGE} ${REGISTRY}/${REPO}:dev2 + - run: docker push ${REGISTRY}/${REPO}:dev2 deploy-stage: if: github.repository == 'goodjoblife/GoodJobShare' && github.event_name == 'push' && github.ref == 'refs/heads/master' runs-on: ubuntu-latest @@ -118,3 +135,16 @@ jobs: -H "Accept: application/vnd.github.v3+json" \ -d '{"event_type": "goodjobshare-dev-published"}' \ https://api.github.com/repos/goodjoblife/goodjob-deploy-ci/dispatches + deploy-dev2: + if: github.repository == 'goodjoblife/GoodJobShare' && github.event_name == 'push' && github.ref == 'refs/heads/dev2' + runs-on: ubuntu-latest + needs: + - docker-dev2 + steps: + - name: Deploy dev + run: | + curl --user "${{ secrets.DEPLOY_CI_TOKEN }}" \ + -X POST \ + -H "Accept: application/vnd.github.v3+json" \ + -d '{"event_type": "goodjobshare-dev2-published"}' \ + https://api.github.com/repos/goodjoblife/goodjob-deploy-ci/dispatches