Update dependencies #176
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pipeline | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
BROKENROBOT_PORT: 8080 | |
jobs: | |
verify: | |
name: 'Verify' | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.node-version' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Format check | |
run: npm run format:check | |
- name: Lint check | |
run: npm run lint:check | |
- name: Type check | |
run: npm run type:check | |
- name: Set up TerraForm | |
uses: hashicorp/setup-terraform@v3 | |
- name: Go to infra/aws | |
run: cd infra/aws | |
- name: TerraForm format check | |
run: terraform fmt -check | |
- name: TerraForm init | |
run: terraform init | |
- name: TerraForm validate | |
run: terraform validate -no-color | |
build: | |
name: 'Build' | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.node-version' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Upload dist | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/ | |
retention-days: 3 | |
test: | |
name: 'Test' | |
runs-on: ubuntu-24.04 | |
needs: build | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.node-version' | |
cache: 'npm' | |
- name: Download dist | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist/ | |
- name: Install dependencies | |
run: npm ci | |
- name: Install Playwright Browsers | |
run: npm run install:playwright | |
- name: E2E test check | |
run: npm run test:e2e:check | |
- name: Upload e2e test reports | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: e2e-test-reports | |
path: reports/tests/e2e/ | |
retention-days: 3 | |
deploy: | |
name: 'Deploy' | |
runs-on: ubuntu-24.04 | |
needs: [verify, build, test] | |
if: github.ref == 'refs/heads/main' | |
timeout-minutes: 10 | |
environment: Production | |
concurrency: | |
group: Production | |
cancel-in-progress: true | |
steps: | |
- name: Download dist | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist/ | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Deploy to AWS S3 | |
run: aws s3 sync dist/ s3://${{ secrets.AWS_S3_BUCKET_NAME }} --delete | |
- name: Invalidate AWS CloudFront cache | |
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" |