Skip to content

xp/2023-07-19-hero-generate-code (#391) #30

xp/2023-07-19-hero-generate-code (#391)

xp/2023-07-19-hero-generate-code (#391) #30

name: continuous-integration
on:
workflow_dispatch:
push:
branches: [main]
release:
types: [published]
jobs:
continuous-integration:
name: continuous-integration
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: install dependencies
run: npm ci
- name: lint site
run: npm run lint
- name: build site
run: npm run build
configure:
name: configure deployment target environment
runs-on: ubuntu-20.04
outputs:
environment: ${{ steps.environment-identifier.outputs.environment }}
steps:
- id: environment-identifier
run: |
if [[ "${{ github.ref_name }}" == "${{ github.event.repository.default_branch }}" ]];
then
echo environment="staging" >> $GITHUB_OUTPUT
elif [[ "${{ github.ref_type }}" == "tag" ]];
then
echo environment="production" >> $GITHUB_OUTPUT
fi;
release:
name: release
needs: [continuous-integration, configure]
uses: ./.github/workflows/release.template.yml
with:
branch: ${{ github.ref_name }}
environment-name: ${{ needs.configure.outputs.environment }}
project-name: "website"
secrets:
ECR_AWS_ACCESS_KEY_ID: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
ECR_AWS_SECRET_ACCESS_KEY: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}