Skip to content

Commit

Permalink
Added CI/CD - removed environments
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaljanicki committed Feb 26, 2024
1 parent 1c43a29 commit ed4412f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
24 changes: 2 additions & 22 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,18 @@ name: Publish frontend
on:
push:
branches:
- develop
- master

env:
NODE_VERSION: 16.x

jobs:
set_environment:
runs-on: ubuntu-latest

steps:
- name: Set up environment based on branch
id: environment_check
run: |
SIMPLE_REF=$(echo ${GITHUB_REF#refs/heads/} | tr / -)
[ "$SIMPLE_REF" = "master" ] && ENV_NAME="prod" || ENV_NAME="$SIMPLE_REF"
echo "env_name=${ENV_NAME}" >> $GITHUB_OUTPUT
outputs:
env_name: ${{ steps.environment_check.outputs.env_name }}

build:
runs-on: ubuntu-latest
needs: [set_environment]
permissions:
id-token: write
contents: read

environment:
name: ${{ needs.set_environment.outputs.env_name }}

steps:
- uses: actions/checkout@v4

Expand All @@ -45,7 +25,7 @@ jobs:
aws-region: ${{ vars.AWS_REGION }}

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

Expand All @@ -59,4 +39,4 @@ jobs:
env:
PUBLISH_DOCS_USERNAME: ${{ vars.PUBLISH_DOCS_USERNAME }}
PUBLISH_DOCS_PASSWORD: ${{ vars.PUBLISH_DOCS_PASSWORD }}
run: npm run publish-${{ needs.set_environment.outputs.env_name }}
run: npm run publish-prod
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack --config webpack.config.js",
"publish-develop": "npm run build && python publish.py",
"publish-prod": "npm run build && python publish.py --stage prod"
},
"repository": {
Expand Down

0 comments on commit ed4412f

Please sign in to comment.