-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (43 loc) · 1.66 KB
/
deploy-live.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: Deploy Production
env:
REPO_NAME: ${{ github.event.repository.name }}
REPO_OWNER: ${{ github.repository_owner }}
on:
workflow_dispatch:
release:
types: [created]
jobs:
build_and_tag:
runs-on: ubuntu-latest
environment: Production
services:
docker:
image: docker:19.03.5-dind
options: --privileged
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: main
- name: Build Docker image
run: |
docker build -t inhousequeue-site \
--build-arg DATABASE_URL=${{ secrets.DATABASE_URL }} \
--build-arg NEXTAUTH_SECRET=${{ secrets.NEXTAUTH_SECRET }} \
--build-arg DISCORD_CLIENT_ID=${{ secrets.DISCORD_CLIENT_ID }} \
--build-arg DISCORD_CLIENT_SECRET=${{ secrets.DISCORD_CLIENT_SECRET }} \
--build-arg UPSTASH_REDIS_REST_URL=${{ secrets.UPSTASH_REDIS_REST_URL }} \
--build-arg UPSTASH_REDIS_REST_TOKEN=${{ secrets.UPSTASH_REDIS_REST_TOKEN }} \
.
- name: Login to Amazon ECR
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Tag and push Docker image
run: |
export ECR_REPOSITORY=${{ secrets.ECR_REPO }}
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $ECR_REPOSITORY
docker tag inhousequeue-site:latest $ECR_REPOSITORY:latest
docker push $ECR_REPOSITORY:latest