forked from CodeYourFuture/Full-Stack-Project-Assessment
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
508 additions
and
10 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,37 @@ | ||
node_modules | ||
.env | ||
.env | ||
|
||
# Local .terraform directories | ||
**/.terraform/* | ||
|
||
# .tfstate files | ||
*.tfstate | ||
*.tfstate.* | ||
|
||
# Crash log files | ||
crash.log | ||
crash.*.log | ||
|
||
# Exclude all .tfvars files, which are likely to contain sensitive data, such as | ||
# password, private keys, and other secrets. These should not be part of version | ||
# control as they are data points which are potentially sensitive and subject | ||
# to change depending on the environment. | ||
*.tfvars | ||
*.tfvars.json | ||
|
||
# Ignore override files as they are usually used to override resources locally and so | ||
# are not checked in | ||
override.tf | ||
override.tf.json | ||
*_override.tf | ||
*_override.tf.json | ||
|
||
# Include override files you do wish to add to version control using negated pattern | ||
# !example_override.tf | ||
|
||
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan | ||
# example: *tfplan* | ||
|
||
# Ignore CLI configuration files | ||
.terraformrc | ||
terraform.rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,3 +73,45 @@ You are welcome to use [Bootstrap](https://getbootstrap.com/docs/4.0/getting-sta | |
Fork this repository and then clone it to your computer. | ||
|
||
Progress to Level 100 when you are ready. | ||
|
||
|
||
|
||
name: Node.js Deployment | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Update and Upgrade EC2 inst | ||
run: | | ||
sudo apt update | ||
sudo apt upgrade -y | ||
|
||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 12 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
npm install | ||
|
||
- name: rsync deployments | ||
uses: burnett01/[email protected] | ||
with: | ||
switches: -avzr --exclude=node_modules --delete | ||
path: ./server/ | ||
remote_path: ~/.video-app/ | ||
remote_host: ${{ secrets.AWS_HOST }} | ||
remote_port: 22 | ||
remote_user: ${{ secrets.USERNAME }} | ||
remote_key: ${{ secrets.SSH_PRIVATE_KEY }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
provider "aws" { | ||
region = "eu-west-2" | ||
access_key = var.access_key | ||
secret_key = var.secret_key | ||
} | ||
|
||
# Define variables | ||
variable "access_key" {} | ||
variable "secret_key" {} | ||
|
||
resource "aws_s3_bucket" "video-app-olha" { | ||
bucket = "video-app-olha" | ||
} | ||
|
||
|
||
resource "aws_s3_bucket_ownership_controls" "video-app-olha" { | ||
bucket = aws_s3_bucket.video-app-olha.id | ||
rule { | ||
object_ownership = "BucketOwnerPreferred" | ||
} | ||
} | ||
|
||
resource "aws_s3_bucket_public_access_block" "video-app-olha" { | ||
bucket = aws_s3_bucket.video-app-olha.id | ||
|
||
block_public_acls = false | ||
block_public_policy = false | ||
ignore_public_acls = false | ||
restrict_public_buckets = false | ||
} | ||
|
||
resource "aws_s3_bucket_acl" "video-app-olha" { | ||
depends_on = [ | ||
aws_s3_bucket_ownership_controls.video-app-olha, | ||
aws_s3_bucket_public_access_block.video-app-olha, | ||
] | ||
|
||
bucket = aws_s3_bucket.video-app-olha.id | ||
acl = "public-read" | ||
} | ||
|
||
resource "aws_s3_bucket_website_configuration" "video-app-olha-web" { | ||
bucket = aws_s3_bucket.video-app-olha.id | ||
|
||
index_document { | ||
suffix = "index.html" | ||
} | ||
|
||
error_document { | ||
key = "error.html" | ||
} | ||
|
||
routing_rule { | ||
condition { | ||
key_prefix_equals = "docs/" | ||
} | ||
redirect { | ||
replace_key_prefix_with = "documents/" | ||
} | ||
} | ||
|
||
depends_on = [aws_s3_bucket.video-app-olha] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,37 @@ | ||
node_modules | ||
.env | ||
.env | ||
|
||
# Local .terraform directories | ||
**/.terraform/* | ||
|
||
# .tfstate files | ||
*.tfstate | ||
*.tfstate.* | ||
|
||
# Crash log files | ||
crash.log | ||
crash.*.log | ||
|
||
# Exclude all .tfvars files, which are likely to contain sensitive data, such as | ||
# password, private keys, and other secrets. These should not be part of version | ||
# control as they are data points which are potentially sensitive and subject | ||
# to change depending on the environment. | ||
*.tfvars | ||
*.tfvars.json | ||
|
||
# Ignore override files as they are usually used to override resources locally and so | ||
# are not checked in | ||
override.tf | ||
override.tf.json | ||
*_override.tf | ||
*_override.tf.json | ||
|
||
# Include override files you do wish to add to version control using negated pattern | ||
# !example_override.tf | ||
|
||
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan | ||
# example: *tfplan* | ||
|
||
# Ignore CLI configuration files | ||
.terraformrc | ||
terraform.rc |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.