-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (52 loc) · 1.66 KB
/
deploy.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
50
51
52
53
54
55
56
57
58
name: Deploy Nodes
on:
push:
branches:
- main
jobs:
deploy:
concurrency: main
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: xmtpeng
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Git Checkout
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: Push
id: push
run: |
export DOCKER_IMAGE_TAG=latest
IMAGE_TO_DEPLOY=xmtp/node-go@$(dev/docker/build)
echo Successfully pushed $IMAGE_TO_DEPLOY
echo "docker_image=${IMAGE_TO_DEPLOY}" >> $GITHUB_OUTPUT
- name: Deploy (dev)
uses: xmtp-labs/terraform-deployer@v1
timeout-minutes: 45
with:
timeout: 45m
terraform-token: ${{ secrets.TERRAFORM_TOKEN }}
terraform-org: xmtp
terraform-workspace: dev
variable-name: xmtp_node_image
variable-value: ${{ steps.push.outputs.docker_image }}
variable-value-required-prefix: "xmtp/node-go@sha256:"
- name: Deploy (production)
uses: xmtp-labs/terraform-deployer@v1
timeout-minutes: 45
with:
timeout: 45m
terraform-token: ${{ secrets.TERRAFORM_TOKEN }}
terraform-org: xmtp
terraform-workspace: production
variable-name: xmtp_node_image
variable-value: ${{ steps.push.outputs.docker_image }}
variable-value-required-prefix: "xmtp/node-go@sha256:"