Skip to content

Commit 3cfbac8

Browse files
committed
Commit deploy workflow and test it out
- Update readme
1 parent 3a6039e commit 3cfbac8

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout Code
17+
uses: actions/checkout@v4
18+
with:
19+
submodules: recursive
20+
21+
- name: Set up AWS CLI
22+
uses: aws-actions/configure-aws-credentials@v1
23+
with:
24+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
25+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
26+
aws-region: us-east-1
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: '3.11'
32+
33+
- name: Install Python dependencies
34+
run: pip install boto3 PyYaml
35+
36+
- name: Run deployment script to deploy files to S# website
37+
run: python update-website.py

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,23 @@ My personal website files for www.elderek.com and www.derekmelder.com
102102
1. Leave Routing Policy and Evaluate Target Health alone
103103
1. Now type your website into your browser and confirm both addresses (ex: elderek.com and www.elderek.com) are working
104104

105-
### Using create-website.py
105+
### Using update-website.py
106106

107107
1. Read: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
108108
1. Install aws-cli
109109
1. Configure aws-cli credentials with aws configure
110110
1. Install Python 3
111111
1. ```pip install boto3 PyYaml```
112-
1. Update the region, domain_name, and stack_name variables in create-website.py
113-
1. ```py create-website.py```
112+
1. Update the region, domain_name, and stack_name variables in update-website.py
113+
1. ```py update-website.py```
114+
115+
### Using GitHub actions
116+
117+
1. Update the region, domain_name, and stack_name variables in update-website.py
118+
1. Go to your repository -> Settings -> Secrets and variables -> Actions -> New repository secret (ex: https://github.com/Gelean/website/settings/secrets/actions)
119+
1. Add a key titled AWS_ACCESS_KEY_ID with your AWS access key
120+
1. Add a key titled AWS_SECRET_ACCESS_KEY with your AWS secret access key
121+
1. Make a commit and confirm the GitHub actions fired off correctly
114122

115123
## Docker image
116124

@@ -124,7 +132,6 @@ My personal website files for www.elderek.com and www.derekmelder.com
124132

125133
### Tear down the Docker container
126134

127-
128135
1. ```docker rm $(docker stop $(docker ps -aq --filter ancestor=elderek-website-image --format="{{.ID}}"))```
129136
1. Alternate tear down commands:
130137
1. ```docker ps -aq | xargs -n 1 docker stop```

0 commit comments

Comments
 (0)