Merge pull request #3 from kenyipp/develop #3
This file contains hidden or 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: Continuous Integration | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '**.md' # Ignore changes to markdown files | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
env: | |
NODE_ENV: test | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set Up Node.js Environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.18.0 | |
cache: 'yarn' # Cache Yarn dependencies | |
- name: Install Dependencies | |
run: yarn install --frozen-lockfile # Ensures dependencies match yarn.lock | |
- name: Run Code Linting | |
run: yarn lint | |
deploy: | |
name: Deploy to Production | |
environment: | |
name: production | |
runs-on: ubuntu-latest | |
needs: lint | |
steps: | |
- name: Trigger AWS CodePipeline | |
run: | |
aws codepipeline start-pipeline-execution --name ${{ | |
vars.CODE_BUILD_PIPELINE }} --region ${{ vars.AWS_REGION }} | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
release: | |
name: Release | |
needs: lint | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # Allow action to push to github | |
packages: write | |
pull-requests: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Checkout code | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.18.0 | |
- name: Run semantic-release | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: npx semantic-release |