update url status in match #72
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 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 }} |