From e8b95e32baff39ec562ba2ac47b1d4ba3efaa46d Mon Sep 17 00:00:00 2001 From: Thomas Amland Date: Sun, 26 Jul 2020 12:33:06 +0200 Subject: [PATCH] setup github actions --- .github/workflows/ci.yml | 61 ++++++++++++++++++++++++++++++++++++++++ .gitlab-ci.yml | 36 ------------------------ README.md | 2 +- 3 files changed, 62 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..148138b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,61 @@ +name: CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + with: + node-version: '12.x' + + - name: Install dependencies + run: yarn install + + - name: Build + run: yarn build + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: dist + path: dist + + preview: + runs-on: ubuntu-latest + needs: build + if: github.event_name == 'pull_request' + steps: + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: dist + + - name: Deploy preview + uses: netlify/actions/cli@master + env: + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + with: + args: deploy --dir=. + + deploy: + runs-on: ubuntu-latest + needs: build + if: github.ref == 'refs/heads/master' + steps: + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: dist + + - name: Deploy site + uses: netlify/actions/cli@master + env: + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + with: + args: deploy --dir=. --prod diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index b978ae9..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,36 +0,0 @@ -image: node:13-alpine - -stages: - - build - - deploy-dev - - deploy-prod - -variables: - NETLIFY_SITE_ID: airsonic - -build: - stage: build - script: - - export VUE_APP_VERSION=$CI_COMMIT_SHORT_SHA - - yarn install - - yarn build - artifacts: - paths: - - dist - -deploy dev: - stage: deploy-dev - script: - - npm i -g netlify-cli - - netlify deploy --dir dist --site $NETLIFY_SITE_ID --auth $NETLIFY_AUTH_TOKEN - -deploy production: - stage: deploy-prod - environment: - name: production - url: https://airsonic.netlify.com - only: - - master - script: - - npm i -g netlify-cli - - netlify deploy --dir dist --site $NETLIFY_SITE_ID --auth $NETLIFY_AUTH_TOKEN --prod diff --git a/README.md b/README.md index 5024b09..bc9106e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Airsonic Web Client -[![pipeline status](https://gitlab.com/tamland/airsonic-frontend/badges/master/pipeline.svg)](https://gitlab.com/tamland/airsonic-ui/pipelines) +[![](https://github.com/tamland/airsonic-frontend/workflows/CI/badge.svg)](https://github.com/tamland/airsonic-frontend/actions) Modern responsive web frontend for [Airsonic](https://github.com/airsonic/airsonic). It's currently based on the [Subsonic API](http://www.subsonic.org/pages/api.jsp) and should work with other backends implementing this API as well.