Skip to content

style changes

style changes #237

Workflow file for this run

name: CI/CD frontend
on:
push:
paths:
- 'frontend/**'
- '!backend/**'
- '.github/workflows/frontend.yml'
pull_request:
paths:
- 'frontend/**'
- '.github/workflows/frontend.yml'
- '!backend/**'
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: noi-techpark/github-actions/checkout@v2
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v1
- name: Test frontend
uses: actions/setup-node@v2
with:
node-version: '14.x'
cache: 'yarn'
cache-dependency-path: frontend/yarn.lock
- run: |
yarn install
yarn run test --passWithNoTests
working-directory: frontend
deploy-test-frontend:
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/main'
needs: test
concurrency: deploy-test-frontend
env:
AWS_S3_BUCKET_NAME : 'webcompstore-test'
AWS_REGION : "eu-west-1"
steps:
- name: Checkout source code
uses: noi-techpark/github-actions/checkout@v2
- name: Create .env file
uses: noi-techpark/github-actions/env-file@v2
env:
X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }}
X_API_BASE_URL: "https://api.webcomponents.opendatahub.testingmachine.eu"
X_CDN_URL: "https://cdn.webcomponents.opendatahub.testingmachine.eu"
X_HCAPTCHA_PUBLIC_KEY: 9f9020fc-605d-4f9a-b4d6-a80091e5abc8
X_BUILD_ENVIRONMENT: testing
with:
working-directory: frontend
- name: Setup node and yarn
uses: actions/setup-node@v2
with:
node-version: '14.x'
cache: 'yarn'
cache-dependency-path: frontend/yarn.lock
- name: Build
run: |
yarn install
yarn run build
working-directory: frontend
- name: Sync to S3 bucket
uses: noi-techpark/github-actions/aws-s3-bucket-sync@v2
with:
access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
secret-access-key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
region: ${{ env.AWS_REGION }}
s3-bucket-name: ${{ env.AWS_S3_BUCKET_NAME }}
folder: ./frontend/dist
deploy-production-frontend:
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/prod'
needs: test
concurrency: deploy-production-frontend
env:
AWS_S3_BUCKET_NAME : 'webcompstore-prod'
AWS_REGION : "eu-west-1"
SCRIPTS_HOST: 'https://scripts.opendatahub.com'
steps:
- name: Checkout source code
uses: noi-techpark/github-actions/checkout@v2
- name: Create .env file
uses: noi-techpark/github-actions/env-file@v2
env:
X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }}
X_API_BASE_URL: "https://api.webcomponents.opendatahub.com"
X_CDN_URL: "https://cdn.webcomponents.opendatahub.com"
X_HCAPTCHA_PUBLIC_KEY: 9f9020fc-605d-4f9a-b4d6-a80091e5abc8
X_BUILD_ENVIRONMENT: production
with:
working-directory: frontend
- name: Setup node and yarn
uses: actions/setup-node@v2
with:
node-version: '14.x'
cache: 'yarn'
cache-dependency-path: frontend/yarn.lock
- name: Change scripts host to prod
run: sed -i -e "s%https://scripts.opendatahub.testingmachine.eu%${{env.SCRIPTS_HOST}}%g" frontend/nuxt.config.js
- name: Build
run: |
yarn install
yarn run build
working-directory: frontend
- name: Sync to S3 bucket
uses: noi-techpark/github-actions/aws-s3-bucket-sync@v2
with:
access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
secret-access-key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
region: ${{ env.AWS_REGION }}
s3-bucket-name: ${{ env.AWS_S3_BUCKET_NAME }}
folder: ./frontend/dist