merge main into match-making #76
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: Channel4-backend CI/CD | |
on: | |
push: | |
branches: ["*"] | |
jobs: | |
test: | |
name: Test | |
environment: backend_secrets | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.JS ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: 'Create env file' | |
run: | | |
echo "${{ secrets.ENV_FILE_TEST }}" > .env.test | |
cat .env.test | |
- name: NPM install, build and test | |
run: | | |
npm install | |
npm run typechain:create | |
npm test | |
env: | |
NODE_ENV: test | |
deploy: | |
name: Deploy | |
if: github.ref == 'refs/heads/main' | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to production | |
uses: johnbeynon/[email protected] | |
with: | |
service-id: ${{ secrets.SERVICE_ID }} | |
api-key: ${{ secrets.RENDER_API_KEY }} |