diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..5bc0c68 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,45 @@ +name: Deploy + +on: + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: "16" + - name: Install dependencies + run: npm ci + - name: Build + run: npm run build + - uses: actions/upload-artifact@v3 + with: + name: website-build + path: out + + deploy: + permissions: + contents: write + needs: [ build ] + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v3 + with: + name: website-build + path: website + + - name: 📂 Sync files + uses: SamKirkland/FTP-Deploy-Action@v4.3.4 + with: + server: w01e537f.kasserver.com + username: w01e537f + password: ${{ secrets.ONEWARE_STUDIO_FTP }} + local-dir: website/ + server-dir: oneware.studio/ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..1d78835 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Node.js CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x, 18.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run build --if-present + - run: npm test