Skip to content

Commit

Permalink
Refactor CI/CD pipeline configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Furkan-Gulsen committed Dec 12, 2023
1 parent 2b948ee commit 637e79e
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: CI/CD Pipeline

on:
push:
branches:
- main

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.21'

- name: Test
run: make test

- name: Build
if: success()
run: make build

- name: Configure AWS credentials
if: success()
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1

- name: Deploy
if: success()
run: |
sam deploy --stack-name golang-url-shortener --capabilities CAPABILITY_IAM --resolve-s3 --no-confirm-changeset --no-fail-on-empty-changeset
# name: CI/CD Pipeline

# on:
# push:
# branches:
# - main

# jobs:
# deploy-with-sam:
# runs-on: ubuntu-latest

# steps:
# - name: Checkout Repository
# uses: actions/checkout@v2

# - name: Set up Go
# uses: actions/setup-go@v2
# with:
# go-version: '1.21'

# - name: Test
# run: make test

# - name: Build
# if: success()
# run: make build

# - name: Configure AWS credentials
# if: success()
# uses: aws-actions/configure-aws-credentials@v1
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: eu-central-1

# - name: Deploy
# if: success()
# run: |
# sam deploy --stack-name golang-url-shortener --capabilities CAPABILITY_IAM --resolve-s3 --no-confirm-changeset --no-fail-on-empty-changeset

0 comments on commit 637e79e

Please sign in to comment.