Skip to content

Commit

Permalink
Merge pull request #61 from oslokommune/sync-gha
Browse files Browse the repository at this point in the history
Sync GitHub Actions with blueprints
  • Loading branch information
simenheg authored Apr 5, 2024
2 parents 79b82ac + 66df205 commit 900da6a
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 36 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ name: "CodeQL"

on:
push:
branches: [ main ]
branches: [main]
paths-ignore:
- '**/*.md'
pull_request:
branches: [ main ]
branches: [main]
paths-ignore:
- '**/*.md'
schedule:
- cron: '0 6 * * 1'
- cron: "0 6 * * 1"
workflow_dispatch:

jobs:
Expand All @@ -23,17 +27,17 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
language: ["python"]

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@d13ca047ae14d02299ae648f2ba451622ecb7270 # v3.23.1
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@d13ca047ae14d02299ae648f2ba451622ecb7270 # v3.23.1
11 changes: 6 additions & 5 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,26 @@ on:
push:
branches:
- main
paths-ignore:
- '**/*.md'
workflow_dispatch:

jobs:
deploy-dev:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Python 3.11
uses: actions/setup-python@v2
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: '3.11'
- name: Install Python dependencies
run: pip install tox
- name: Test with tox
run: tox -e py,flake8,black
- uses: actions/setup-node@v1
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: '12.x'
node-version: '18.x'
- name: Install NPM dependencies
run: npm install
- name: Deploy Lambda functions
Expand Down
39 changes: 19 additions & 20 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,23 @@ on:
jobs:
deploy-prod:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install Python dependencies
run: pip install tox
- name: Test with tox
run: tox -e py,flake8,black
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install NPM dependencies
run: npm install
- name: Deploy Lambda functions
run: |
AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_PROD }} \
AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY_PROD }} \
./node_modules/.bin/sls deploy -s prod
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Python 3.11
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: '3.11'
- name: Install Python dependencies
run: pip install tox
- name: Test with tox
run: tox -e py,flake8,black
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: '18.x'
- name: Install NPM dependencies
run: npm install
- name: Deploy Lambda functions
run: |
AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_PROD }} \
AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY_PROD }} \
./node_modules/.bin/sls deploy -s prod
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
pull-requests: write

steps:
- uses: actions/labeler@v3
- uses: actions/labeler@ac9175f8a1f3625fd0d4fb234536d26811351594 # v4.3.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
7 changes: 4 additions & 3 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ name: PR Tests

on:
pull_request:
paths-ignore:
- '**/*.md'

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Python 3.11
uses: actions/setup-python@v2
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: '3.11'
- name: Install dependencies
Expand Down

0 comments on commit 900da6a

Please sign in to comment.