Skip to content

Commit

Permalink
deploy s3
Browse files Browse the repository at this point in the history
  • Loading branch information
tanjilbhuiyan committed May 16, 2024
1 parent f9cd1a0 commit fcdb445
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 38 deletions.
54 changes: 27 additions & 27 deletions .github/workflows/golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_REGION: ${{ vars.AWS_REGION }}

steps:
- name: Checkout
Expand All @@ -21,35 +21,35 @@ jobs:
fetch-depth: 0
# Checkout the source code from the repository

- name: Setup Golang
id: setup_golang
uses: actions/[email protected]
with:
go-version: '1.20'
# Set up the Go environment
# - name: Setup Golang
# id: setup_golang
# uses: actions/[email protected]
# with:
# go-version: '1.20'
# # Set up the Go environment

- name: action-zip
uses: montudor/[email protected]
# Zip the source code
# - name: action-zip
# uses: montudor/[email protected]
# # Zip the source code

- name: Setting up change file detection action
id: changed-files-specific
uses: tj-actions/[email protected]
with:
base_sha: ${{ steps.get-base-sha.outputs.base_sha }}
files: |
**/*.go
json: "true"
# Detect any changes in the Go files
# - name: Setting up change file detection action
# id: changed-files-specific
# uses: tj-actions/[email protected]
# with:
# base_sha: ${{ steps.get-base-sha.outputs.base_sha }}
# files: |
# **/*.go
# json: "true"
# # Detect any changes in the Go files

- name: Run step if any file(s) in the integration folder change
if: steps.changed-files-specific.outputs.any_changed == 'true'
run: |
echo "List all the files that have changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}"
echo "${{ steps.changed-files-specific.outputs.all_changed_files }}" > list.txt
cp ../.github/scripts/golang-build-deploy.sh .
bash golang-build-deploy.sh
# Execute build and deploy script if any Go files have changed
# - name: Run step if any file(s) in the integration folder change
# if: steps.changed-files-specific.outputs.any_changed == 'true'
# run: |
# echo "List all the files that have changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}"
# echo "${{ steps.changed-files-specific.outputs.all_changed_files }}" > list.txt
# cp ../.github/scripts/golang-build-deploy.sh .
# bash golang-build-deploy.sh
# # Execute build and deploy script if any Go files have changed

- name: Setup Terraform
id: Setting_up_terraform
Expand Down
21 changes: 11 additions & 10 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Define module for golang-lambda-1
module "golang-lambda-1" {
source = "./lambda/github-lambda-test-1"
s3_bucket = module.golang-lambda-bucket.s3-bucket-function_name
}
# # Define module for golang-lambda-1
# module "golang-lambda-1" {
# source = "./lambda/github-lambda-test-1"
# s3_bucket = module.golang-lambda-bucket.s3-bucket-function_name
# }

# Define module for golang-lambda-2
module "golang-lambda-2" {
source = "./lambda/github-lambda-test-2"
s3_bucket = module.golang-lambda-bucket.s3-bucket-function_name
}
# # Define module for golang-lambda-2
# module "golang-lambda-2" {
# source = "./lambda/github-lambda-test-2"
# s3_bucket = module.golang-lambda-bucket.s3-bucket-function_name

# }

# Define module for golang-lambda-bucket
module "golang-lambda-bucket" {
Expand Down
2 changes: 1 addition & 1 deletion s3/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "aws_s3_bucket" "builds" {
bucket = "my-unique-bucket-golang-lambda-test"
bucket = "my-unique-bucket-golang-lambda-test-Ran@2021"
}

# Define ownership controls for the bucket
Expand Down

0 comments on commit fcdb445

Please sign in to comment.