Skip to content

Commit

Permalink
Add GitHub Actions workflows for automatic issue/project management a…
Browse files Browse the repository at this point in the history
…nd Azure deployment

Signed-off-by: anchit-chandran <[email protected]>
  • Loading branch information
anchit-chandran committed Apr 9, 2024
1 parent c432efd commit 7a0b8fe
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/all-branches-and-PRs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4 # latest as at February 2024
- uses: actions/checkout@v4 # latest as at Apr 2024

- name: Set up Python version ${{ matrix.python-version }}
uses: actions/setup-python@v5 # latest as at March 2024
uses: actions/setup-python@v5 # latest as at Apr 2024
with:
python-version: ${{ matrix.python-version }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Add issue or PR to project automatically
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.4.0
- uses: actions/add-to-project@v1.0.0 # latest as at April 2024
with:
project-url: https://github.com/orgs/rcpch/projects/5 #dGC Project
github-token: ${{ secrets.AUTO_ADD_TO_PROJECT_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4 # Latest as at April 2024
- name: Run Labeller
if: success()
uses: crazy-max/ghaction-github-labeler@v4
uses: crazy-max/ghaction-github-labeler@v5 # Latest as at April 2024
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: .github/labels.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# and pushes it to Azure from where it is deployed
# to the LIVE site https://growth.rcpch.ac.uk/
#
# Azure will also build a preview site for any PRs against LIVE or branches
# Azure will also build a preview site for any branches and any PRs against `live`.

name: ALL-BRANCHES-ALL-PRs-build-and-deploy-to-azure.yml

Expand All @@ -27,19 +27,18 @@ jobs:
ENABLE_GIT_COMMITTERS: True # Makes git-committers an option, default disabled, when building locally
name: Build and Deploy to Azure
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4 # latest as at Apr 2024
with:
fetch-depth: 0 # required for git-revision and git-committers plugins to work properly in CI
submodules: true
- uses: actions/setup-python@v4
- uses: actions/setup-python@5 # latest as at Apr 2024
with:
python-version: '3.11'
#- run: pip install git+https://${{ secrets.MATERIAL_FOR_MKDOCS_ACCESS_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
- run: pip install -r requirements.txt
- run: mkdocs build
python-version: '3.12'
- run: pip install -r documentation/docs-requirements.txt
- run: mkdocs build --config-file documentation/mkdocs.yml
- name: Upload to Azure
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
uses: Azure/static-web-apps-deploy@v1 # latest as at Apr 2024
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_GLACIER_063C32703 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for GitHub integrations (i.e. PR comments)
Expand All @@ -50,15 +49,16 @@ jobs:
api_location: "" # Api source code path relative to repository root - optional
output_location: "site" # Built app content directory, relative to app_location - optional
###### End of Repository/Build Configurations ######


# Deletes temporary deployment on Azure when PR is closed, therefore no longer needed.
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
uses: Azure/static-web-apps-deploy@v1 # latest as at Apr 2024
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_GLACIER_063C32703 }}
action: "close"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
issues: write
steps:
- name: Add comment
uses: peter-evans/create-or-update-comment@v1
uses: peter-evans/create-or-update-comment@v4 # Latest as at April 2024
with:
issue-number: ${{ github.event.issue.number }}
body: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4 # latest as at March 2024
- uses: actions/checkout@v4 # latest as at April 2024

- name: Set up Python version
uses: actions/setup-python@v5 # latest as at March 2024
uses: actions/setup-python@v5 # latest as at April 2024
with:
python-version: '3.12'

Expand All @@ -36,7 +36,7 @@ jobs:
run: zip release.zip ./* -r

- name: Upload artifact for deployment jobs
uses: actions/upload-artifact@v4 # latest as at March 2024
uses: actions/upload-artifact@v4 # latest as at April 2024
with:
name: python-app
path: |
Expand Down

0 comments on commit 7a0b8fe

Please sign in to comment.