Replace CI configuration with a new workflow structure #5
This file contains hidden or 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: Example CI Pipeline | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| install: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Install dependencies | |
| run: echo "Installing dependencies..." | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: install | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Build application | |
| run: echo "Building the application..." | |
| - name: Log secret environment variable | |
| run: echo "The value of MY_SECRET is ${{ secrets.MY_SECRET }}" | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Test application | |
| run: echo "Testing the application..." | |
| deploy: | |
| if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| needs: test | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Deploy application | |
| run: echo "Deploying the application..." |