Skip to content

Commit

Permalink
Merge pull request #465 from salopensource/ghr
Browse files Browse the repository at this point in the history
ChatGPT said this should work
  • Loading branch information
grahamgilbert authored Nov 6, 2024
2 parents 26baca4 + fadc226 commit f4119d7
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/build-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build Latest

on:
workflow_run:
workflows: ["Test"]
types:
- completed

jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' }}
steps:
- uses: actions/checkout@v2

- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Build and Push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: ghcr.io/salopensource/sal:latest
35 changes: 35 additions & 0 deletions .github/workflows/build-saml-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build Latest SAML

on:
workflow_run:
workflows: ["Test"]
types:
- completed

jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' }}
steps:
- uses: actions/checkout@v2

- name: Checkout another repository
uses: actions/checkout@v2
with:
repository: salopensource/sal-saml
path: saml

- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Build and Push Docker image
uses: docker/[email protected]
with:
context: .
file: saml/Dockerfile.pristine
push: true
tags: ghcr.io/salopensource/sal-saml:latest
35 changes: 35 additions & 0 deletions .github/workflows/build-saml-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build Tag

on:
workflow_run:
workflows: ["Test"]
types:
- completed

jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_commit.message, 'tag:') }}
steps:
- uses: actions/checkout@v2

- name: Checkout another repository
uses: actions/checkout@v2
with:
repository: salopensource/sal-saml
path: saml

- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Build and Push Docker image
uses: docker/[email protected]
with:
context: .
push: true
file: saml/Dockerfile.pristine
tags: ghcr.io/salopensource/sal-saml:${{ github.ref_name }}
28 changes: 28 additions & 0 deletions .github/workflows/build-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build Tag

on:
workflow_run:
workflows: ["Test"]
types:
- completed

jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_commit.message, 'tag:') }}
steps:
- uses: actions/checkout@v2

- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Build and Push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: ghcr.io/salopensource/sal:${{ github.ref_name }}
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test

on: push

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.9

- name: Install dependencies
run: |
pip install -r setup/requirements.txt
pip install flake8
- name: Setup Test Environment
run: |
cp sal/example_settings.py sal/settings.py
- name: Run Tests
run: |
python manage.py test
python manage.py migrate
- name: Run Linting
run: |
flake8
2 changes: 1 addition & 1 deletion sal/version.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>version</key>
<string>4.3.0.2278</string>
<string>4.3.0.2287</string>
</dict>
</plist>

0 comments on commit f4119d7

Please sign in to comment.