From 859e7037154c05ba8a1e94cfb63d7d9220fdd266 Mon Sep 17 00:00:00 2001 From: Charles OuGuo Date: Wed, 24 Jul 2024 22:11:03 -0400 Subject: [PATCH] Deploy ark_nova_stats to fly.io (#289) --- .github/workflows/main.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 139124f1..ccebdf06 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,69 +35,76 @@ jobs: run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //... push_ark_nova_stats: needs: build + if: ${{ github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Login to Docker Hub - if: ${{ github.ref == 'refs/heads/main' }} uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Push to Docker Hub - if: ${{ github.ref == 'refs/heads/main' }} run: | bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc run --build_tag_filters=manual --stamp --embed_label $(git rev-parse HEAD) //ark_nova_stats/api:api_image_image_dockerhub + deploy_ark_nova_stats: + needs: push_ark_nova_stats + if: ${{ github.ref == 'refs/heads/main' }} + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: superfly/flyctl-actions/setup-flyctl@master + - run: flyctl deploy + working-directory: ark_nova_stats/api push_fitbit_challenges: needs: build + if: ${{ github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Login to Docker Hub - if: ${{ github.ref == 'refs/heads/main' }} uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Push to Docker Hub - if: ${{ github.ref == 'refs/heads/main' }} run: | bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc run --build_tag_filters=manual --stamp --embed_label $(git rev-parse HEAD) //fitbit_challenges/api:api_image_image_dockerhub bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc run --build_tag_filters=manual --stamp --embed_label $(git rev-parse HEAD) //fitbit_challenges/worker:image_dockerhub bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc run --build_tag_filters=manual --stamp --embed_label $(git rev-parse HEAD) //fitbit_challenges/frontend:production_cross_platform_image_dockerhub push_home_api: needs: build + if: ${{ github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Login to Docker Hub - if: ${{ github.ref == 'refs/heads/main' }} uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Push to Docker Hub - if: ${{ github.ref == 'refs/heads/main' }} run: | bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc run --build_tag_filters=manual --stamp --embed_label $(git rev-parse HEAD) //home_api/api:api_image_image_dockerhub bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc run --build_tag_filters=manual --stamp --embed_label $(git rev-parse HEAD) //home_api/frontend:production_cross_platform_image_dockerhub push_mc_manager: needs: build + if: ${{ github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Login to Docker Hub - if: ${{ github.ref == 'refs/heads/main' }} uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Push to Docker Hub - if: ${{ github.ref == 'refs/heads/main' }} run: | bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc run --build_tag_filters=manual --stamp --embed_label $(git rev-parse HEAD) //mc_manager/api:api_image_image_dockerhub bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc run --build_tag_filters=manual --stamp --embed_label $(git rev-parse HEAD) //mc_manager/worker:image_dockerhub