diff options
| author | 2023-03-07 22:27:43 +0100 | |
|---|---|---|
| committer | 2023-05-05 10:59:18 +0100 | |
| commit | 540971d4f447bfc4364a221b4bbbab41feb40068 (patch) | |
| tree | 85e5009ffbc1f64b50cf57031158c0086ae2417e | |
| parent | Seperate build & deploy from lint (diff) | |
Move CI to reusable workflows
| -rw-r--r-- | .github/workflows/main.yaml | 37 | 
1 files changed, 37 insertions, 0 deletions
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..fd44690 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,37 @@ +name: CI + +on: +  push: +    branches: +      - main +  pull_request: + +concurrency: +  group: ${{ github.workflow }}-${{ github.ref }} +  cancel-in-progress: true + +jobs: +  generate-sha-tag: +    if: github.ref == 'refs/heads/main' +    runs-on: ubuntu-latest +    outputs: +      sha-tag: ${{ steps.sha-tag.outputs.sha-tag }} +    steps: +      - name: Create SHA Container tag +        id: sha-tag +        run: | +          tag=$(cut -c 1-7 <<< $GITHUB_SHA) +          echo "sha-tag=$tag" >> $GITHUB_OUTPUT + +  lint: +    uses: ./.github/workflows/lint.yaml + +  build-deploy: +    if: github.ref == 'refs/heads/main' +    uses: ./.github/workflows/build-deploy.yaml +    needs: +      - lint +      - generate-sha-tag +    with: +      sha-tag: ${{ needs.generate-sha-tag.outputs.sha-tag }} +    secrets: inherit  |