Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
chore: upgrade deprecated GitHub actions (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-saja authored May 23, 2023
1 parent 3a9b79b commit 48fbace
Show file tree
Hide file tree
Showing 5 changed files with 508 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @vuestorefront/integrations-team
* @vuestorefront/storefronts-team
14 changes: 9 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,19 @@ jobs:
name: Lint PR Title (conventional-commit)
needs: prepare_dependencies
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Dependencies
run: rm package.json && npm install @commitlint/config-conventional
- uses: ./.github/actions/install-dependencies
with:
NPM_EMAIL: ${{ secrets.NPM_EMAIL }}
NPM_USER: ${{ secrets.NPM_USER }}
NPM_PASS: ${{ secrets.NPM_PASS }}

- name: Run linter
uses: JulienKode/[email protected]
- name: Validate PR title
run: echo "${{ github.event.pull_request.title }}" | npx commitlint

lint-code:
name: Lint code
Expand Down Expand Up @@ -110,7 +114,7 @@ jobs:
-Dsonar.organization=vuestorefront
-Dsonar.projectKey=vuestorefront_storefront-nuxt2-magento2
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info
-Dsonar.coverage.exclusions=/__tests__/**,*.config.js,**/*.*
-Dsonar.coverage.exclusions=/__tests__/**,*.config.js
-Dsonar.cpd.exclusions=/__tests__/**
performance-tests:
Expand Down
35 changes: 17 additions & 18 deletions .github/workflows/deploy-vue-storefront-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Determine environment-specific variables
shell: bash
id: resolve-env-filename
Expand All @@ -21,7 +21,6 @@ jobs:
if [ $REF = 'refs/heads/main' ]; then
ENVINFO_FILE=production
else
echo 'unrecognized branch name'
exit 1
Expand All @@ -35,17 +34,17 @@ jobs:
needs: configure-deployment
steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Setup deployment environments variables
shell: bash
run: |
cat .github/workflows/public_env_info/${{ needs.configure-deployment.outputs.env-info-file }} >> $GITHUB_ENV
- name: Setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: "16.x"
- name: Build and publish docker image
uses: elgohr/Publish-Docker-Github-Action@master
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: ${{ secrets.PROJECT_NAME }}-storefrontcloud-io/vue-storefront:${{ github.sha }}
registry: ${{ secrets.DOCKER_REGISTRY_URL || 'registry.vuestorefront.cloud' }}
Expand All @@ -65,17 +64,17 @@ jobs:
needs: configure-deployment
steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Setup deployment environments variables
shell: bash
run: |
cat .github/workflows/public_env_info/${{ needs.configure-deployment.outputs.env-info-file }} >> $GITHUB_ENV
- name: Setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: "16.x"
- name: Build and publish docker image
uses: elgohr/Publish-Docker-Github-Action@master
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: ${{ secrets.PROJECT_NAME }}-storefrontcloud-io/vue-storefront-middleware:${{ github.sha }}
registry: ${{ secrets.DOCKER_REGISTRY_URL || 'registry.vuestorefront.cloud' }}
Expand All @@ -95,14 +94,14 @@ jobs:
deployments: write
needs: [configure-deployment, build-storefront, build-middleware]
steps:
- uses: chrnorm/deployment-action@releases/v1
- uses: chrnorm/deployment-action@v2
name: Create GitHub deployment
id: deployment
with:
token: "${{ github.token }}"
target_url: https://${{ secrets.PROJECT_NAME }}.${{ secrets.CLOUD_REGION }}.gcp.storefrontcloud.io
environment-url: https://${{ secrets.PROJECT_NAME }}.${{ secrets.CLOUD_REGION }}.gcp.storefrontcloud.io
environment: production
initial_status: in_progress
initial-status: in_progress

- name: Deploy on ${{ secrets.PROJECT_NAME }}.${{ secrets.CLOUD_REGION }}.gcp.storefrontcloud.io
run: |
Expand Down Expand Up @@ -132,20 +131,20 @@ jobs:
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@releases/v1
uses: chrnorm/deployment-status@v2
with:
token: "${{ github.token }}"
target_url: https://${{ secrets.PROJECT_NAME }}.${{ secrets.CLOUD_REGION }}.gcp.storefrontcloud.io
environment-url: https://${{ secrets.PROJECT_NAME }}.${{ secrets.CLOUD_REGION }}.gcp.storefrontcloud.io
state: "success"
description: Congratulations! The deploy is done.
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
deployment-id: ${{ steps.deployment.outputs.deployment_id }}

- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@releases/v1
uses: chrnorm/deployment-status@v2
with:
token: "${{ github.token }}"
target_url: https://${{ secrets.PROJECT_NAME }}.${{ secrets.CLOUD_REGION }}.gcp.storefrontcloud.io
description: Unfortunately, the instance hasn't been updated.
environment-url: https://${{ secrets.PROJECT_NAME }}.${{ secrets.CLOUD_REGION }}.gcp.storefrontcloud.io
state: "failure"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
description: Unfortunately, the instance hasn't been updated.
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
},
"devDependencies": {
"@babel/core": "^7.18.6",
"@commitlint/config-conventional": "^13.2.0",
"@lhci/cli": "^0.11.0",
"@nuxt/types": "latest",
"@nuxt/typescript-build": "2.1.0",
Expand All @@ -78,6 +79,7 @@
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^28.1.2",
"commitlint": "^17.6.3",
"concurrently": "7.6.0",
"cors": "2.8.5",
"cypress": "^10.3.0",
Expand Down
Loading

0 comments on commit 48fbace

Please sign in to comment.