Skip to content

Merge pull request #21 from MarceloVichar/develop #3

Merge pull request #21 from MarceloVichar/develop

Merge pull request #21 from MarceloVichar/develop #3

Workflow file for this run

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 generate
- name: S3 Sync
if: success()
run: aws s3 sync .output/ s3://${{ steps.get-bucket-name.outputs.name }}