diff --git a/.github/workflows/test.yml b/.github/workflows/ci.yml similarity index 74% rename from .github/workflows/test.yml rename to .github/workflows/ci.yml index b97592d..521df3f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/ci.yml @@ -15,14 +15,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v1 - name: Install run: bun install + - name: Build + run: bun tsc + - name: Cypress run - run: bunx cypress run --component --browser chrome + run: bun cypress run --component --browser chrome env: NODE_ENV: production diff --git a/.github/workflows/tf-plan.yml b/.github/workflows/tf-plan.yml deleted file mode 100644 index 3853078..0000000 --- a/.github/workflows/tf-plan.yml +++ /dev/null @@ -1,104 +0,0 @@ -name: Terraform - -on: - pull_request: - branches: - - main - paths: - - 'terraform/**' - - '.github/workflows/tf-plan.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - id-token: write - pull-requests: write - -defaults: - run: - working-directory: terraform - -jobs: - terraform: - name: Plan - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-region: us-east-2 - role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-iam-role - - - name: Create State Bucket - run: | - if aws s3api head-bucket --bucket "${BUCKET_NAME}" 2>/dev/null - then - echo "Bucket exists: $BUCKET_NAME" - else - echo "Bucket does not exist, creating: ${BUCKET_NAME}" - aws s3 mb s3://"${BUCKET_NAME}" - fi - env: - BUCKET_NAME: last-dram-terraform-us-east-2 - - - name: Setup - uses: hashicorp/setup-terraform@v2 - - - name: Format - id: fmt - run: terraform fmt -check - - - name: Init - id: init - run: terraform init - - - name: Validate - id: validate - run: terraform validate -no-color - - - name: Plan - id: plan - run: terraform plan -no-color - continue-on-error: true - - - uses: actions/github-script@v6 - if: github.event_name == 'pull_request' - env: - PLAN: "terraform\n${{ steps.plan.outputs.stdout }}" - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\` - #### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\` - #### Terraform Validation 🤖\`${{ steps.validate.outcome }}\` -
Validation Output - - \`\`\`\n - ${{ steps.validate.outputs.stdout }} - \`\`\` - -
- - #### Terraform Plan 📖\`${{ steps.plan.outcome }}\` - -
Show Plan - - \`\`\`\n - ${process.env.PLAN} - \`\`\` - -
- - *Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Working Directory: \`${{ env.tf_actions_working_dir }}\`, Workflow: \`${{ github.workflow }}\`*`; - - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: output - }) diff --git a/.github/workflows/tf-apply.yml b/.github/workflows/tf.yml similarity index 88% rename from .github/workflows/tf-apply.yml rename to .github/workflows/tf.yml index a296b40..4c2f74f 100644 --- a/.github/workflows/tf-apply.yml +++ b/.github/workflows/tf.yml @@ -21,10 +21,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-region: us-east-2 role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-iam-role @@ -42,7 +42,7 @@ jobs: BUCKET_NAME: last-dram-terraform-us-east-2 - name: Setup - uses: hashicorp/setup-terraform@v2 + uses: hashicorp/setup-terraform@v3 - name: Init run: terraform init