Skip to content

Commit

Permalink
ci: Optimize order of jobs (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
pnu-s authored Jun 22, 2022
1 parent c0b29f7 commit 7f95099
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 17 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
push:
branches:
- v1
tags:
- v*
pull_request:
branches:
- v1
Expand Down Expand Up @@ -57,15 +55,26 @@ jobs:
run: |
pipenv check
continue-on-error: true
- uses: hadolint/hadolint-action@v2.1.0
with:
dockerfile: docker/Dockerfile
- name: Run tests
run: |
cd exodus
python manage.py test
env:
DJANGO_SETTINGS_MODULE: exodus.settings.dev

hadolint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: hadolint/hadolint-action@v2.1.0
with:
dockerfile: docker/Dockerfile

docker_build:
needs: hadolint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
Expand All @@ -74,15 +83,3 @@ jobs:
context: .
file: ./docker/Dockerfile
push: false

release:
needs: build
name: Create Github release
if: github.event_name == 'push' && github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create release
run: gh release create ${GITHUB_REF_NAME} --title ${GITHUB_REF_NAME} --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: release

on:
push:
tags:
- v*

jobs:
release:
name: Create Github release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create release
run: gh release create ${GITHUB_REF_NAME} --title ${GITHUB_REF_NAME} --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7f95099

Please sign in to comment.