From 662bbaae8b04e52ef1f6979dc433614db2d4e768 Mon Sep 17 00:00:00 2001 From: LukasDeco <41474751+LukasDeco@users.noreply.github.com> Date: Wed, 26 Jun 2024 22:42:18 -0600 Subject: [PATCH] feat: build prod ci/cd (#17) --- .github/workflows/build-production.yml | 54 ++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/build-production.yml diff --git a/.github/workflows/build-production.yml b/.github/workflows/build-production.yml new file mode 100644 index 0000000..f721c49 --- /dev/null +++ b/.github/workflows/build-production.yml @@ -0,0 +1,54 @@ +name: PRODUCTION -- Build & Push Docker Image +on: + push: + branches: [main] + paths: + - "**" + +jobs: + build_and_push: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + with: + submodules: "true" + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: lukasdeco/indexer + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + file: Dockerfile + push: true + tags: themetadao/asset-watcher:main + labels: ${{ steps.meta.outputs.labels }} + + # redeploy_app: + # name: Redeploy app on Railway + # needs: build_and_push + # runs-on: ubuntu-latest + # steps: + # - name: Call Redeploy API + # env: + # RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} + # run: | + # echo railway toke: $RAILWAY_TOKEN + # echo "Authorization: Bearer ${RAILWAY_TOKEN}" + # curl https://backboard.railway.app/graphql/v2 \ + # -X POST \ + # -H "Authorization: Bearer ${RAILWAY_TOKEN}" \ + # -H "Content-Type: application/json" \ + # --data '{"query": "mutation serviceInstanceDeploy($serviceId: String!, $environmentId: String!) {\n serviceInstanceDeploy(serviceId: $serviceId, environmentId: $environmentId)\n}\n", "variables": { "environmentId": "0942e3fe-8ec3-49b4-b8fb-26eb10b6e08f", "serviceId": "783719dc-3c30-437d-a3a9-b1aeb1d5c487" } }'