Skip to content

Commit

Permalink
Added CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaljanicki committed Feb 27, 2024
1 parent 0034dea commit 63aa33d
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 4 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish frontend

on:
push:
branches:
- develop
- master

env:
NODE_VERSION: 16.x

jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read

steps:
- uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.GH_OIDC_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}

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

- name: Install Node requirements
run: npm i

- name: Install Python requirements
run: pip install -r requirements.txt

- name: Build and publish
env:
PUBLISH_DOCS_USERNAME: ${{ vars.PUBLISH_DOCS_USERNAME }}
PUBLISH_DOCS_PASSWORD: ${{ secrets.PUBLISH_DOCS_PASSWORD }}
run: |
SIMPLE_REF=$(echo ${GITHUB_REF#refs/heads/} | tr / -)
npm run publish-${SIMPLE_REF}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*node_modules
*node_modules
.idea
dist/
1 change: 0 additions & 1 deletion dist/app.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/license.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack --config webpack.config.js",
"publish": "npm run build && python publish.py",
"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 63aa33d

Please sign in to comment.