Adds docker cache #10
Workflow file for this run
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: Pipeline | ||
on: | ||
pull_request: | ||
push: | ||
tags: | ||
- "v*" | ||
workflow_dispatch: | ||
env: | ||
DOCKER_BUILDKIT: 1 | ||
PROJECT_DOCKER_CACHE_BACKEND: ${{ vars.PROJECT_DOCKER_CACHE_BACKEND }} | ||
PROJECT_DOCKER_HOST: ${{ vars.PROJECT_DOCKER_HOST }} | ||
PROJECT_DOCKER_ORG: ${{ vars.PROJECT_DOCKER_ORG }} | ||
PROJECT_DOCKER_PLATFORMS: ${{ vars.PROJECT_DOCKER_PLATFORMS }} | ||
PROJECT_NAME: ${{ vars.PROJECT_NAME }} | ||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Prepare | ||
uses: schubergphilis/prepare-action@v1 | ||
with: | ||
type: container | ||
job: lint | ||
- name: Lint | ||
run: | | ||
make lint | ||
scan: | ||
name: Scan | ||
runs-on: ubuntu-22.04 | ||
needs: lint | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Prepare | ||
uses: schubergphilis/prepare-action@v1 | ||
with: | ||
type: container | ||
job: scan | ||
- name: Scan | ||
run: | | ||
make scan | ||
pre-ci: | ||
name: Pre-CI | ||
runs-on: ubuntu-22.04 | ||
needs: scan | ||
outputs: | ||
platforms: ${{ steps.platforms.outputs.value }} | ||
steps: | ||
- name: Get Platforms as JSON | ||
id: platforms | ||
run: | | ||
echo "value=[\"$(echo $PROJECT_DOCKER_PLATFORMS | sed 's/,/\",\"/g')\"]" >> $GITHUB_OUTPUT | ||
ci: | ||
name: CI | ||
runs-on: ubuntu-22.04 | ||
needs: pre-ci | ||
strategy: | ||
matrix: | ||
platforms: ${{ fromJSON(needs.pre-ci.outputs.platforms) }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Prepare | ||
uses: schubergphilis/prepare-action@v1 | ||
with: | ||
type: container | ||
job: ci | ||
- name: Build | ||
env: | ||
PROJECT_DOCKER_PLATFORMS: ${{ matrix.platforms }} | ||
run: | | ||
make build | ||
- name: Test | ||
env: | ||
PROJECT_DOCKER_PLATFORMS: ${{ matrix.platforms }} | ||
run: | | ||
make test | ||
cd: | ||
name: CD | ||
runs-on: ubuntu-22.04 | ||
needs: ci | ||
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Prepare | ||
uses: schubergphilis/prepare-action@v1 | ||
with: | ||
type: container | ||
job: cd | ||
- name: Login to GitHub Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ PROJECT_DOCKER_HOST }} | ||
Check failure on line 116 in .github/workflows/pipeline.yml GitHub Actions / PipelineInvalid workflow file
|
||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Release | ||
run: | | ||
make release |