Skip to content

Commit

Permalink
Merge pull request #19 from MarceloVichar/develop
Browse files Browse the repository at this point in the history
cd s3
  • Loading branch information
MarceloVichar authored Jan 24, 2024
2 parents c7cedbc + e06f7c6 commit 1fe4231
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI/CD - Production - Pipeline

on:
push:
branches: [main]
workflow_dispatch:

jobs:
deployment:

runs-on: ubuntu-latest

env:
ENV: production
NUXT_PUBLIC_API_BASE: https://api.lets.tur.br

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

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_S3_REGION }}

- name: Repository Name
run: echo ${{ github.repository }}

- name: Get bucket name
id: get-bucket-name
run: echo "::set-output name=name::v2.lets.tur.br"

- name: S3 Search
id: s3-search-bucket
run: echo "::set-output name=code::$(aws s3 ls s3://${{ steps.get-bucket-name.outputs.name }} || echo $?)"

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 20.x

- name: Install dependencies
run: npm i

- name: Build
run: npm run build

- name: S3 Sync
if: success()
run: aws s3 sync dist/ s3://${{ steps.get-bucket-name.outputs.name }}

0 comments on commit 1fe4231

Please sign in to comment.