diff --git a/.github/workflows/deploy-beta.yml b/.github/workflows/deploy-beta.yml new file mode 100644 index 000000000..4f6f4732b --- /dev/null +++ b/.github/workflows/deploy-beta.yml @@ -0,0 +1,61 @@ +name: Deploy beta +on: + push: + branches: [master] +jobs: + docker: + name: Build Publish and Deploy Beta + runs-on: ubuntu-latest + steps: + - + name: Check Out Repo + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + - + name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + - + name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + file: docker/etl-rest-server/Dockerfile + builder: ${{ steps.buildx.outputs.name }} + push: true + tags: ampathke/etl-services:beta + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} + - + name: Spin up ETL nomad job + uses: fjogeleit/http-request-action@master + with: + url: https://${{ secrets.AMPATH_CI_HOST }}/levant/deploy?branch=${{ steps.extract_branch.outputs.branch }} + method: "GET" + customHeaders: '{ "Accept": "application/json", "Content-Type": "application/json" }' + - + name: Expose an external URL + uses: fjogeleit/http-request-action@master + with: + url: https://${{ secrets.AMPATH_CI_HOST }}/etl?branch=${{ steps.extract_branch.outputs.branch }} + method: "GET" + customHeaders: '{ "Accept": "application/json", "Content-Type": "application/json" }' + diff --git a/.github/workflows/deploy-test-build.yml b/.github/workflows/deploy-test-build.yml new file mode 100644 index 000000000..a1a022a43 --- /dev/null +++ b/.github/workflows/deploy-test-build.yml @@ -0,0 +1,77 @@ +# Build, publish & deploy $branch +name: Deploy test-build +on: + create: + branches: '*' +jobs: + docker: + name: Build Publish and Deploy + runs-on: ubuntu-latest + steps: + # Check out code + - + name: Checkout + uses: actions/checkout@v2 + # This is the a separate action that sets up buildx runner + - + name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + # So now you can use Actions' own caching! + - + name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + # And make it available for the builds + - + name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + file: docker/etl-rest-server/Dockerfile + builder: ${{ steps.buildx.outputs.name }} + push: true + tags: ampathke/etl-services:${{ steps.extract_branch.outputs.branch }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new + # This ugly bit is necessary if you don't want your cache to grow forever + # till it hits GitHub's limit of 5GB. + # Temp fix + - + name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} + - + name: Spin up ETL nomad job + uses: fjogeleit/http-request-action@master + with: + url: https://${{ secrets.AMPATH_CI_HOST }}/levant/deploy?branch=${{ steps.extract_branch.outputs.branch }} + method: "GET" + customHeaders: '{ "Accept": "application/json", "Content-Type": "application/json" }' + - + name: Expose an external URL + uses: fjogeleit/http-request-action@master + with: + url: https://${{ secrets.AMPATH_CI_HOST }}/etl?branch=${{ steps.extract_branch.outputs.branch }} + method: "GET" + customHeaders: '{ "Accept": "application/json", "Content-Type": "application/json" }' diff --git a/.prettierignore b/.prettierignore index 31fd7febb..707616d1c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -13,3 +13,4 @@ conf/config-bk.json dist build .build +.github/workflows/