-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (60 loc) · 2.83 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: alhazenlabs-ec2-deployment
on:
push:
branches: [main]
jobs:
start:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: "3.0.100"
- name: Dump Github Context
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
INSTANCE_ID: ${{ secrets.INSTANCE_ID }}
run: |
echo $AWS_REGION
echo $AWS_ACCESS_KEY_ID
echo $AWS_SECRET_ACCESS_KEY
echo $INSTANCE_ID
# -run: |
# echo ${{ secrets.AWS_REGION }}
# echo ${{ secrets.AWS_ACCESS_KEY_ID }}
# echo ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# echo ${{ secrets.INSTANCE_ID }}
# - uses: actions/checkout@v2
# - name: AWS SSM Send-Command
# uses: peterkimzz/aws-ssm-send-command@master
# id: ssm
# with:
# aws-region: ${{ secrets.AWS_REGION }}
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# instance-ids: ${{ secrets.INSTANCE_ID }}
# working-directory: /home/ubuntu/deployment
# command: /bin/sh ./deploy.sh
# Catch SSM outputs
# - name: Get the outputs
# run: echo "The Command id is ${{ steps.ssm.outputs.command-id }}"
## Setting up your Domain
# So far, users can access the site using the Elastic IP. However, it can be difficult to remember and share so we will configure a custom domain name.
# To get started, you need to first purchase a domain. This can range from $10 to $1,000+s. Amazon has a service called Route53 you can use or you can choose other providers such as [Google Domains](https://domains.google/), [GoDaddy](https://www.godaddy.com/), etc. (we used Google for AlgoAcademy which was $10/year).
# There are two steps you would need to configure to connect the project with a custom domain:
# - Create domain records with DNS registrar
# - Configure NGINX on the EC2 instance to recognize the domain
# ---
# ### _Creating Domain records_
# Let's start with configuring our DNS with records:
# - Go to the **DNS** portion of your registrar.
# - Find where you can create custom resource records.
# Set the records like so:
# | Name | Type | TTL | Data |
# | ---- | :---: | :-: | ----------------------: |
# | @ | A | 1h | YOUR-ELASTIC-IP-ADDRESS |
# | www | CNAME | 1h | your-awesome-site.com |
# ### _Configuring our Web Server_
# Edit the NGINX config file inside your EC2 instance: