Skip to content

Commit

Permalink
Create blank.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jumainfomagnus authored Oct 8, 2024
1 parent 4606187 commit ea244bb
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: CI Workflow

# Trigger CI for every PR event, when PR has target branch = main
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
# The first job lints the code base
lint:
uses: githubabcs/gh-abcs-actions/.github/workflows/super-linter.yml@main

# CI job to run a test suite on the code base
ci:
name: CI
# We want to test across mutiple OSs, defined by our matrix
runs-on: ${{ matrix.os }}
needs: lint
strategy:
# Cancel all matrix jobs if one of them fails
fail-fast: false
matrix:
# our matrix for testing across node versions and OSs
node-version: [14, 16]
os: [macos-latest, windows-latest, ubuntu-latest]

steps:
- name: Checkout
uses: actions/checkout@v4

# Configure our node environment according to matrix
- name: Setup node ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Run test suite
run: |
echo npm ci
echo npm run build --if-present
echo npm test
# Add here the upload-artifact action
- shell: bash
run: |
echo 'Test upload artifact' > output.log
- name: Upload output file
uses: actions/upload-artifact@v4
with:
name: output-log-file
path: output.log

# If both linting and CI succeeds we want to deploy the code to a test environment
deploy-test:
name: Deploy to test env
runs-on: ubuntu-latest
needs: ci
environment:
name: TEST
url: https://test.company.com
steps:
- name: Checkout
uses: actions/checkout@v4

# Add here the download-artifact step
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: output-log-file

# Placeholder - this step would be some action or run commands that deploys the code
- name: Deploy to test env
if: ${{ success() }}
run: |
echo "Deploying to test environment"

0 comments on commit ea244bb

Please sign in to comment.