-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (45 loc) · 1.39 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: 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: themetadao/indexer
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: packages/indexer/Dockerfile
push: true
tags: themetadao/indexer: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
run: |
curl https://backboard.railway.app/graphql/v2 \
-X POST \
-H "Authorization: Bearer ${{ secrets.RAILWAY_TOKEN }}" \
-H "Content-Type: application/json" \
--data "{\"query\":\"mutation { deploymentRedeploy(id: \\\"${{ secrets.RAILWAY_DEPLOYMENT_ID }}\\\") { status } }\"}" \