Skip to content

Commit

Permalink
Merge pull request #3208 from OfficeForProductSafetyAndStandards/feat…
Browse files Browse the repository at this point in the history
…/update-workflows

Update workflows
  • Loading branch information
rubenarakelyan authored Nov 14, 2023
2 parents 38008b3 + 4a2a241 commit 40b5610
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ updates:
schedule:
interval: daily
versioning-strategy: lockfile-only
open-pull-requests-limit: 5
- package-ecosystem: npm
directory: "/cosmetics-web"
schedule:
interval: daily
versioning-strategy: lockfile-only
open-pull-requests-limit: 5
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 5
12 changes: 8 additions & 4 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
name: Deploy Production
name: Deploy to Production

on:
push:
branches:
- main
release:
types:
- released

jobs:
deploy:
name: Deploy to Pre-Prod and Production
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Install cf client
env:
CF_CLI_VERSION: v7
Expand Down Expand Up @@ -131,6 +133,8 @@ jobs:
gh_deploy_failure production $LOG_URL
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Create Sentry release
if: success()
uses: getsentry/action-release@v1
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Deploy Staging
"on":
name: Deploy to Staging

on:
push:
branches:
- develop
- main

jobs:
deploy:
name: Deploy to Staging
Expand All @@ -21,7 +23,7 @@ jobs:
- name: Create GitHub deployment for Staging
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
BRANCH: develop
BRANCH: main
run: |
source cosmetics-web/deploy-github-functions.sh
gh_deploy_create staging
Expand All @@ -31,16 +33,14 @@ jobs:
run: >
source cosmetics-web/deploy-github-functions.sh
# URL where the deployment progress can be tracked. Exported for
future steps.
log_url=$(echo
"https://github.com/$GITHUB_REPOSITORY/actions?query=branch%3Adevelop+workflow%3ADeploy+Staging")
"https://github.com/$GITHUB_REPOSITORY/actions?query=branch%3Amain+workflow%3ADeploy+Staging")
echo "LOG_URL=$log_url" >> $GITHUB_ENV
gh_deploy_initiate staging $log_url
- name: Deploy to Staging
env:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/review-apps-delete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ jobs:
runs-on: ubuntu-latest
# Skip if it is a Dependabot created PR. They do not have Review Apps to delete.
if: ${{ github.actor != 'dependabot[bot]' }}

env:
SPACE: int
CF_USERNAME: ${{ secrets.PaaSUsernameInt }}
CF_PASSWORD: ${{ secrets.PaaSPasswordInt }}

steps:
- name: Install cf client
env:
Expand Down
4 changes: 2 additions & 2 deletions cosmetics-web/docs/deployment.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Deployment

Anything which is merged to `develop` will trigger a [GitHub Action](https://github.com/OfficeForProductSafetyAndStandards/cosmetic-product-notifications/actions/workflows/deploy-staging.yml)
Anything which is merged to `main` will trigger a [GitHub Action](https://github.com/OfficeForProductSafetyAndStandards/cosmetic-product-notifications/actions/workflows/deploy-staging.yml)
and deploy the various components to the `staging` space on GOV.UK PaaS.

Anything which is merged to `main` will trigger a [GitHub Action](https://github.com/OfficeForProductSafetyAndStandards/cosmetic-product-notifications/actions/workflows/deploy-production.yml)
A GitHub Release with associated tag will trigger a [GitHub Action](https://github.com/OfficeForProductSafetyAndStandards/cosmetic-product-notifications/actions/workflows/deploy-production.yml)
and deploy the various components to the `pre-prod` and `prod` spaces on GOV.UK PaaS.

## Deployment from scratch
Expand Down
2 changes: 1 addition & 1 deletion cosmetics-web/support_portal/support_portal.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |spec|

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/OfficeForProductSafetyAndStandards/cosmetic-product-notifications"
spec.metadata["changelog_uri"] = "https://github.com/OfficeForProductSafetyAndStandards/cosmetic-product-notifications/blob/develop/support_portal/CHANGELOG.md"
spec.metadata["changelog_uri"] = "https://github.com/OfficeForProductSafetyAndStandards/cosmetic-product-notifications/blob/main/support_portal/CHANGELOG.md"

spec.files = Dir.chdir(File.expand_path(__dir__)) do
Dir["{app,config,db,lib}/**/*", "CHANGELOG.md", "Rakefile", "README.md"]
Expand Down

0 comments on commit 40b5610

Please sign in to comment.