Add ttl to auto remove old failed (#252) #426
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: proposals-sync | |
on: | |
pull_request: | |
branches: [ main ] | |
push: | |
branches: [ main ] | |
release: | |
types: [ published ] | |
jobs: | |
set_env: | |
uses: ./.github/workflows/reusable.environment.yml | |
with: | |
commit: ${{ github.event.inputs.commit }} | |
check_changed: | |
needs: set_env | |
uses: ./.github/workflows/reusable.changes.yml | |
with: | |
files: | | |
.github/workflows/proposals-sync.yml | |
helm/configs/proposals/${{ needs.set_env.outputs.environment }}/** | |
helm/configs/proposals/values.yaml | |
proposals/** | |
commit: ${{ needs.set_env.outputs.commit }} | |
test_lint: | |
if: (needs.set_env.outputs.environment == 'development' && needs.check_changed.outputs.changed == 'true') | |
runs-on: ubuntu-latest | |
needs: check_changed | |
defaults: | |
run: | |
working-directory: proposals | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.inputs.commit }} | |
- name: Helm template | |
run: | | |
helm template proposals --debug ../helm/charts/duo_facility_proposals --values=../helm/configs/proposals/values.yaml --values=../helm/configs/proposals/development/values.yaml > /dev/null | |
- name: Build | |
run: | | |
cp docker-compose.dev.yml docker-compose.yml | |
docker compose up -d --build | |
- name: Test | |
run: docker compose exec -T app pytest | |
- name: Black | |
run: docker compose exec -T app black --check --diff --no-color ./src | |
- name: Isort | |
run: docker compose exec -T app isort --check --diff ./src | |
- name: Pylint | |
run: docker compose exec -T app pylint ./src | |
continue-on-error: true | |
- name: Build prod | |
run: docker build -t prod . | |
- name: Cleanup | |
if: ${{ always() }} | |
run: docker compose down | |
build_deploy: | |
if: (needs.check_changed.outputs.changed == 'true' && !needs.set_env.outputs.component && needs.set_env.outputs.environment != 'development') || needs.set_env.outputs.component == 'pr' | |
needs: | |
- check_changed | |
- set_env | |
uses: ./.github/workflows/reusable.build-deploy.yml | |
with: | |
context: proposals/. | |
image_name: ${{ github.repository }}/proposals | |
release_name: proposals | |
tag: ${{ needs.set_env.outputs.tag }} | |
environment: ${{ needs.set_env.outputs.environment }} | |
helm_chart: helm/charts/duo_facility_proposals | |
commit: ${{ needs.set_env.outputs.commit }} | |
secrets: | |
KUBECONFIG: ${{ secrets.KUBECONFIG }} | |
JSON_SECRETS: ${{ toJSON(secrets) }} | |
BASTION_USER: ${{ secrets.BASTION_USER }} | |
BASTION_SSH_KEY: ${{ secrets.BASTION_SSH_KEY }} |