build: set check to only PR #27
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: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
release: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
checks: | |
name: 'checks' | |
if: ${{ github.event_name == 'pull_request'}} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
# To work with pants --changed-since we need an adequate number | |
# of commits in the checkout | |
fetch-depth: "100" | |
- name: 'checks' | |
uses: ./.github/workflows/templates/checks | |
build: | |
name: 'build' | |
if: always() && (needs.checks.result == 'success' || needs.checks.result == 'skipped') | |
needs: checks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: 'docker login' | |
run: docker login -u _json_key -p "$ARTIFACT_SA" europe-west4-docker.pkg.dev | |
env: | |
ARTIFACT_SA: ${{ secrets.GOOGLE_CREDENTIALS }} | |
- name: 'set version (release)' | |
if: ${{ github.event_name == 'release' }} | |
run: | | |
VERSION=$(echo $GITHUB_REF | sed -e 's/refs\/tags\///g') | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: 'set version (push)' | |
if: ${{ github.event_name == 'push' }} | |
run: | | |
echo "VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- name: 'publish' | |
uses: ./.github/workflows/templates/publish | |
with: | |
version: ${{ env.VERSION }} | |
helm_deployment: | |
name: 'Deploy dagster helm chart' | |
runs-on: ubuntu-latest | |
environment: production | |
needs: build | |
if: always() && (needs.build.result == 'success') && (github.event_name == 'release') | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: 'set version (release)' | |
run: | | |
VERSION=$(echo $GITHUB_REF | sed -e 's/refs\/tags\///g') | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Parse values | |
uses: cuchi/[email protected] | |
with: | |
template: deployment/values.yaml.j2 | |
output_file: ./values_parsed.yaml | |
strict: true | |
variables: | | |
version=${{ env.VERSION }} | |
project_name=jasper-ginn-dagster | |
project_short_name=jgdag | |
- name: deploy | |
uses: ./.github/workflows/templates/deploy | |
with: | |
values: ./values_parsed.yaml | |
google_credentials: ${{ secrets.GOOGLE_CREDENTIALS }} | |
cluster_name: clus-kube-euw4-jgdag-prd | |
region: europe-west4 | |
project_name: jasper-ginn-dagster | |
namespace: dagster-prd |