Skip to content

Commit 44937f9

Browse files
authored
Merge pull request #2465 from dandi/update-gh-actions
Improvements to GitHub Actions
2 parents 7666831 + 53c4d5d commit 44937f9

File tree

6 files changed

+45
-17
lines changed

6 files changed

+45
-17
lines changed

.github/workflows/backend-ci.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
- master
99
paths-ignore:
1010
- "web/**"
11-
schedule:
12-
- cron: "0 0 * * *"
11+
permissions:
12+
contents: read
1313
jobs:
1414
test:
1515
runs-on: ubuntu-22.04
@@ -23,10 +23,18 @@ jobs:
2323
env:
2424
POSTGRES_DB: django
2525
POSTGRES_PASSWORD: postgres
26+
options: >-
27+
--health-cmd "pg_isready --username postgres"
28+
--health-start-period 30s
29+
--health-start-interval 2s
2630
ports:
2731
- 5432:5432
2832
rabbitmq:
29-
image: rabbitmq:management
33+
image: rabbitmq:management-alpine
34+
options: >-
35+
--health-cmd "rabbitmq-diagnostics ping"
36+
--health-start-period 30s
37+
--health-start-interval 2s
3038
ports:
3139
- 5672:5672
3240
minio:
@@ -35,14 +43,17 @@ jobs:
3543
env:
3644
MINIO_ROOT_USER: minioAccessKey
3745
MINIO_ROOT_PASSWORD: minioSecretKey
46+
options: >-
47+
--health-cmd "mc ready local"
48+
--health-timeout 1s
49+
--health-start-period 30s
50+
--health-start-interval 2s
3851
ports:
3952
- 9000:9000
4053
steps:
4154
- uses: actions/checkout@v5
4255
- name: Set up Python
4356
uses: actions/setup-python@v5
44-
with:
45-
python-version-file: .python-version
4657
- name: Install tox
4758
run: |
4859
pip install --upgrade pip

.github/workflows/backend-production-deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
release:
55
types: [released]
66

7+
permissions:
8+
contents: write
9+
710
concurrency:
811
# If this workflow is already running, cancel it to avoid a scenario
912
# where the older run finishes *after* the newer run and overwrites
@@ -19,7 +22,6 @@ jobs:
1922
- uses: actions/checkout@v5
2023
with:
2124
fetch-depth: 0 # fetch history for all branches and tags
22-
token: ${{ secrets.GH_TOKEN }} # use PAT with permissions to push to master
2325
ref: release
2426

2527
- name: Perform reset
@@ -39,8 +41,6 @@ jobs:
3941

4042
- name: Set up Python
4143
uses: actions/setup-python@v5
42-
with:
43-
python-version-file: .python-version
4444

4545
- name: Install Heroku CLI
4646
run: curl https://cli-assets.heroku.com/install.sh | sh

.github/workflows/backend-staging-deploy.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- "web/**"
99
- "CHANGELOG.md"
1010

11+
permissions:
12+
contents: read
13+
1114
concurrency:
1215
# If this workflow is already running, cancel it to avoid a scenario
1316
# where the older run finishes *after* the newer run and overwrites
@@ -26,8 +29,6 @@ jobs:
2629

2730
- name: Set up Python
2831
uses: actions/setup-python@v5
29-
with:
30-
python-version-file: .python-version
3132

3233
- name: Install Heroku CLI
3334
run: curl https://cli-assets.heroku.com/install.sh | sh

.github/workflows/cli-integration.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
paths-ignore:
1111
- "web/**"
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
build-image:
1518
runs-on: ubuntu-22.04

.github/workflows/frontend-ci.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
push:
55
branches:
66
- master
7-
schedule:
8-
- cron: "0 0 * * *"
7+
permissions:
8+
contents: read
99
jobs:
1010
lint-type-check:
1111
defaults:
@@ -50,10 +50,18 @@ jobs:
5050
env:
5151
POSTGRES_DB: django
5252
POSTGRES_PASSWORD: postgres
53+
options: >-
54+
--health-cmd "pg_isready --username postgres"
55+
--health-start-period 30s
56+
--health-start-interval 2s
5357
ports:
5458
- 5432:5432
5559
rabbitmq:
56-
image: rabbitmq:management
60+
image: rabbitmq:management-alpine
61+
options: >-
62+
--health-cmd "rabbitmq-diagnostics ping"
63+
--health-start-period 30s
64+
--health-start-interval 2s
5765
ports:
5866
- 5672:5672
5967
minio:
@@ -62,6 +70,11 @@ jobs:
6270
env:
6371
MINIO_ROOT_USER: minioAccessKey
6472
MINIO_ROOT_PASSWORD: minioSecretKey
73+
options: >-
74+
--health-cmd "mc ready local"
75+
--health-timeout 1s
76+
--health-start-period 30s
77+
--health-start-interval 2s
6578
ports:
6679
- 9000:9000
6780
env:
@@ -95,8 +108,6 @@ jobs:
95108

96109
- name: Set up Python
97110
uses: actions/setup-python@v5
98-
with:
99-
python-version-file: .python-version
100111

101112
- name: Install web app
102113
run: yarn install --frozen-lockfile

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- master
77

8+
permissions:
9+
contents: write
10+
811
jobs:
912
release:
1013
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
@@ -13,7 +16,6 @@ jobs:
1316
- uses: actions/checkout@v5
1417
with:
1518
fetch-depth: 0 # fetch history for all branches and tags
16-
token: ${{ secrets.GH_TOKEN }} # use PAT with permissions to push to master
1719

1820
- name: Download latest auto
1921
run: |
@@ -23,6 +25,6 @@ jobs:
2325
2426
- name: Create Release
2527
env:
26-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
28+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2729
run: |
2830
~/auto shipit --message="auto shipit - CHANGELOG.md etc"

0 commit comments

Comments
 (0)