Skip to content

Commit

Permalink
chore: changed CI/CD to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
demtario committed Mar 25, 2024
1 parent 5bf7f19 commit fcc81ea
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 63 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Run Docker image build and tag

on: workflow_dispatch

# on:
# push:
# tags:
# - '*'
# branches:
# - master
# - develop
# - hotfix/*
# - release/*

jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create image tag
env:
IMAGE_TAG: '${{ github.ref_name }}'
run: echo "IMAGE_TAG=${IMAGE_TAG/\//-}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: heseya/roby-storefront:${{ env.IMAGE_TAG }}
29 changes: 29 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Run Linters
on: [push, pull_request]
jobs:
eslint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: yarn install
- name: Run tests and collect coverage
run: yarn lint:eslint
vue-tsc:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: yarn install
- name: Run tests and collect coverage
run: yarn lint:vue
21 changes: 21 additions & 0 deletions .github/workflows/trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Trigger external actions
on:
push:
branches:
- '*'
tags:
- '*'
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Create image tag
env:
IMAGE_NAME: '${{ github.ref_name }}'
run: echo "IMAGE_NAME=${IMAGE_NAME/\//-}" >> $GITHUB_ENV
- name: curl
uses: enflo/curl-action@master
with:
curl: -X POST -F token=${{ secrets.TRIGGER_TOKEN }} -F ref=main -F variables[IMAGE_NAME]=${{ env.IMAGE_NAME }} -F variables[CI_BRANCH]=${{ github.ref_name }} ${{ vars.TRIGGER_URL }}
18 changes: 18 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Run tests and collect code coverage
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: yarn install
- name: Run tests
run: yarn test:unit
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v3
57 changes: 0 additions & 57 deletions .gitlab-ci.yml

This file was deleted.

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ npm run dev

Template uses 3 different APIs. You can change the url of each API by setting the following environment variables.

- Most important is `API_URL` which is used by the application to fetch data from the Heseya API.
- `DIRECTUS_URL` is used by the application to fetch data from the Directus API. This is used for example to fetch the blog posts. This is optional, if you don't have a Directus instance, you can leave this empty.
- `PRICE_TRACKER_URL` is used by the application to fetch data from the Price Tracker API to fullfill the Omnibus requirement.
- Most important is `NUXT_PUBLIC_API_URL` which is used by the application to fetch data from the Heseya API.
- `NUXT_PUBLIC_DIRECTUS_URL` is used by the application to fetch data from the Directus API. This is used for example to fetch the blog posts. This is optional, if you don't have a Directus instance, you can leave this empty.
- `NUXT_PUBLIC_PRICE_TRACKER_URL` is used by the application to fetch data from the Price Tracker API to fullfill the Omnibus requirement.

```env
API_URL=https://api.heseya.com
DIRECTUS_URL=https://cms.heseya.com
PRICE_TRACKER_URL=https://main-price-tracker.heseya.com
NUXT_PUBLIC_API_URL=https://api.heseya.com
NUXT_PUBLIC_DIRECTUS_URL=https://cms.heseya.com
NUXT_PUBLIC_PRICE_TRACKER_URL=https://main-price-tracker.heseya.com
```

### Custom pages
Expand Down

0 comments on commit fcc81ea

Please sign in to comment.