forked from KatLands/dnd-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (50 loc) · 1.54 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
name: Prod Deploy
on:
push:
branches: main
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Checkout project from git
uses: actions/checkout@v3
with:
repository: dragid10/dnd-bot.git
ref: main
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl auth docker && docker login registry.fly.io
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: Login to Flyctl registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/amd64,linux/arm64
tags: registry.fly.io/dnd-bot:latest,registry.fly.io/dnd-bot:production
provenance: false
build-args: |
BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
deploy:
name: Deploy dnd-bot
runs-on: ubuntu-latest
steps:
# This step checks out a copy of your repository.
- name: Checkout project from git
uses: actions/checkout@v3
with:
repository: dragid10/dnd-bot.git
ref: main
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --app dnd-bot --now
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
needs: docker