29 lines
1 KiB
YAML
29 lines
1 KiB
YAML
|
on:
|
||
|
push:
|
||
|
branches:
|
||
|
- master
|
||
|
|
||
|
|
||
|
jobs:
|
||
|
deploy:
|
||
|
runs-on: arch
|
||
|
steps:
|
||
|
- name: Check out repository code
|
||
|
uses: actions/checkout@v3
|
||
|
- name: Install dependencies
|
||
|
run: time npm install
|
||
|
- name: Run Tests
|
||
|
run: npm run test -- --ignore-only
|
||
|
- name: Deply
|
||
|
run: |
|
||
|
CURR_VER=$(cat package.json | jq -r .version)
|
||
|
echo "Checking https://git.nfp.is/api/v1/repos/$APPVEYOR_REPO_NAME/releases for version v${CURR_VER}"
|
||
|
curl -s -X GET -H "Authorization: token ${{ secrets.deploytoken }}" https://git.nfp.is/api/v1/repos/${{ gitea.repository }}/releases | grep -o "\"name\"\:\"v${CURR_VER}\"" > /dev/null
|
||
|
|
||
|
if curl -s -X GET -H "Authorization: token ${{ secrets.deploytoken }}" https://git.nfp.is/api/v1/repos/${{ gitea.repository }}/releases | grep -o "\"name\":\"v${CURR_VER}\"" > /dev/null; then
|
||
|
echo "Skipping ${{ gitea.job }} since $CURR_NAME already exists";
|
||
|
exit 0
|
||
|
fi
|
||
|
|
||
|
echo "Deploying version $CURR_VER to NPM"
|