Skip to content

Commit

Permalink
revise github actions workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
nwaughachukwuma committed Nov 3, 2024
1 parent e8cf5dc commit 63d94cf
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 54 deletions.
40 changes: 9 additions & 31 deletions .github/workflows/deploy.yml → .github/workflows/deploy_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: Deploy app to Google Cloudrun
on:
pull_request:
paths:
- "src/**"
- ".github/workflows/deploy.yml"
- "src/app/**"
- ".github/workflows/deploy_app.yml"
push:
branches:
- main
paths:
- "src/**"
- ".github/workflows/deploy.yml"
- "src/app/**"
- ".github/workflows/deploy_app.yml"
tags:
- "release-*"

Expand Down Expand Up @@ -42,34 +42,12 @@ jobs:
echo "TAGGED=${{ startsWith(github.ref, 'refs/tags/api') }}" >> $GITHUB_OUTPUT
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
lint:
runs-on: ubuntu-latest
needs: prepare
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip" # caching pip dependencies
check-latest: true

- run: pip install --force-reinstall -r requirements.txt
if: ${{ steps.setup-python.outputs.cache-hit != 'true' }}

- run: pip install -r requirements.txt
if: ${{ steps.setup-python.outputs.cache-hit == 'true' }}

- uses: chartboost/ruff-action@v1

deploy:
runs-on: ubuntu-latest
needs: [prepare, lint]
needs: [prepare]
timeout-minutes: 10
permissions:
pull-requests: write
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -91,7 +69,7 @@ jobs:
uses: google-github-actions/deploy-cloudrun@v2
with:
service: ${{ env.SERVICE }}
source: ./
source: ./app
tag: ${{ needs.prepare.outputs.VERSION }}
no_traffic: true
timeout: "5m"
Expand All @@ -116,7 +94,7 @@ jobs:
promote:
runs-on: ubuntu-latest
if: (needs.prepare.outputs.MAIN == 'true')
needs: [prepare, deploy, lint]
needs: [prepare, deploy]
timeout-minutes: 3
steps:
- uses: google-github-actions/auth@v2
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Pylint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip" # caching pip dependencies
check-latest: true

- run: pip install --force-reinstall -r requirements.txt
if: ${{ steps.setup-python.outputs.cache-hit != 'true' }}

- run: pip install -r requirements.txt
if: ${{ steps.setup-python.outputs.cache-hit == 'true' }}

- uses: chartboost/ruff-action@v1
- run: ruff check ./
23 changes: 0 additions & 23 deletions .github/workflows/ruff.yml

This file was deleted.

0 comments on commit 63d94cf

Please sign in to comment.