osa11/pipeline.yml: Corrected action inputs #19
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: Deployment pipeline | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: [main] | |
types: [opened, synchronize] | |
jobs: | |
simple_deployment_pipeline: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Install dependencies | |
run: npm install | |
- name: Run linter | |
run: npm run eslint | |
- name: Build prod | |
run: npm run build | |
- name: Test | |
run: npm run test | |
- name: e2e tests | |
uses: cypress-io/github-action@v5 | |
with: | |
command: npm run test:e2e | |
start: npm run start-prod | |
wait-on: http://localhost:5000 | |
- name: Trigger deployment | |
if: ${{ github.event_name == 'push' }} | |
run: curl https://api.render.com/deploy/srv-${{ secrets.RENDER_SERVICE_ID }}?key=${{ secrets.RENDER_API_KEY }} | |
tag_release: | |
needs: simple_deployment_pipeline # This ensures the job runs after the simple_deployment_pipeline job | |
runs-on: ubuntu-20.04 | |
env: | |
DRY_RUN: false # Set DRY_RUN to true for testing | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch the entire history of the repository, including all branches and tags | |
- name: Bump version and push tag | |
if: github.ref == 'refs/heads/main' # Ensure this job only runs on the main branch | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DRY_RUN: ${{ env.DRY_RUN }} # Pass the DRY_RUN variable to the action | |
with: | |
DEFAULT_BUMP:: patch # Set default bump to patch | |
TAG_PREFIX: "v" # Optional: prefix for the tag | |
DRY_RUN: ${{ env.DRY_RUN }} # Use the DRY_RUN variable to control the action |