-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (62 loc) · 2.19 KB
/
deploy-dev.yml
File metadata and controls
71 lines (62 loc) · 2.19 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Promise Tracker | Deploy | Dev
on:
push:
branches: [main]
concurrency:
group: "${{ github.workflow }} @ ${{ github.ref }}"
cancel-in-progress: true
env:
APP_NAME: promisetracker-v2
DOKKU_REMOTE_BRANCH: "master"
DOKKU_REMOTE_URL: "ssh://azureuser@ui-1.dev.codeforafrica.org"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE_NAME: "codeforafrica/promisetracker-v2"
NEXT_PUBLIC_APP_URL: "https://promisetracker-v2.dev.codeforafrica.org"
SENTRY_ENVIRONMENT: "development"
jobs:
deploy:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20.16]
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
# Add support for more platforms with QEMU (optional)
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
username: ${{ secrets.DOCKER_HUB_USERNAME }}
- name: Build Docker image
uses: docker/build-push-action@v6
with:
build-args: |
NEXT_PUBLIC_APP_URL=${{ env.NEXT_PUBLIC_APP_URL }}
NEXT_PUBLIC_SENTRY_DSN=${{ secrets.SENTRY_DSN }}
SENTRY_ENVIRONMENT=${{ env.SENTRY_ENVIRONMENT }}
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
platforms: linux/arm64
push: true
secrets: |
"database_uri=${{ secrets.DATABASE_URI }}"
"payload_secret=${{ secrets.PAYLOAD_SECRET }}"
"sentry_auth_token=${{ secrets.SENTRY_AUTH_TOKEN }}"
"sentry_org=${{ secrets.SENTRY_ORG }}"
"sentry_project=${{ secrets.SENTRY_PROJECT }}"
tags: "${{ env.IMAGE_NAME }}:${{ github.sha }}"
- name: Push to Dokku
uses: dokku/github-action@v1.7.0
with:
git_remote_url: ${{ env.DOKKU_REMOTE_URL }}/${{ env.APP_NAME }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
deploy_docker_image: ${{ env.IMAGE_NAME }}:${{ github.sha }}