CI: cleanup actions, move REUSE compliance check into every deploy
This commit is contained in:
parent
4034a6c764
commit
52c684dab3
6 changed files with 10 additions and 103 deletions
|
@ -18,6 +18,9 @@ runs:
|
||||||
run: npm ci
|
run: npm ci
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- name: REUSE compliance check
|
||||||
|
uses: fsfe/reuse-action@v2
|
||||||
|
|
||||||
- name: create generated dir
|
- name: create generated dir
|
||||||
run: mkdir ./assets/generated
|
run: mkdir ./assets/generated
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
5
.github/workflows/deploy_dev.yml
vendored
5
.github/workflows/deploy_dev.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Deploy on dev.mapcomplete.org
|
name: Deploy develop on dev.mapcomplete.org
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
@ -8,7 +8,7 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
|
@ -69,6 +69,7 @@ jobs:
|
||||||
cp -r dist/* mapcomplete-dev/
|
cp -r dist/* mapcomplete-dev/
|
||||||
cd mapcomplete-dev/
|
cd mapcomplete-dev/
|
||||||
echo "dev.mapcomplete.org" > CNAME
|
echo "dev.mapcomplete.org" > CNAME
|
||||||
|
touch .nojekyll
|
||||||
git add *
|
git add *
|
||||||
if git status | grep -q "Changes to be committed"
|
if git status | grep -q "Changes to be committed"
|
||||||
then
|
then
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
name: Theme Validation and deployment
|
name: Deploy master on mapcomplete.org
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
@ -8,7 +8,7 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
|
@ -69,6 +69,7 @@ jobs:
|
||||||
cp -r dist/* mapcomplete.github.io/
|
cp -r dist/* mapcomplete.github.io/
|
||||||
cd mapcomplete.github.io/
|
cd mapcomplete.github.io/
|
||||||
echo "mapcomplete.org" > CNAME
|
echo "mapcomplete.org" > CNAME
|
||||||
|
touch .nojekyll
|
||||||
git add *
|
git add *
|
||||||
if git status | grep -q "Changes to be committed"
|
if git status | grep -q "Changes to be committed"
|
||||||
then
|
then
|
11
.github/workflows/reuse-compliance-check.yml
vendored
11
.github/workflows/reuse-compliance-check.yml
vendored
|
@ -1,11 +0,0 @@
|
||||||
name: REUSE Compliance Check
|
|
||||||
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: REUSE Compliance Check
|
|
||||||
uses: fsfe/reuse-action@v2
|
|
52
.github/workflows/validate-pr.yml
vendored
52
.github/workflows/validate-pr.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Build and validate PR
|
name: Build and validate PR (but don't deploy)
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
|
@ -38,53 +38,3 @@ jobs:
|
||||||
- name: run tests
|
- name: run tests
|
||||||
run: npm run test
|
run: npm run test
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Prepare deploy
|
|
||||||
run: npm run prepare-deploy
|
|
||||||
shell: bash
|
|
||||||
- name: Clone deployment repo
|
|
||||||
env:
|
|
||||||
DEPLOY_KEY_PIETERVDVN: ${{ secrets.DEPLOY_KEY_PIETERVDVN }}
|
|
||||||
run: |
|
|
||||||
echo "Cloning destination repo"
|
|
||||||
git config --global user.email "pietervdvn@posteo.net"
|
|
||||||
git config --global user.name "pietervdvn"
|
|
||||||
git clone --depth 1 --single-branch --branch master "https://x-access-token:$DEPLOY_KEY_PIETERVDVN@github.com/pietervdvn/pietervdvn.github.io.git"
|
|
||||||
echo "Destination repo is cloned"
|
|
||||||
|
|
||||||
- name: Sync repo
|
|
||||||
env:
|
|
||||||
DEPLOY_KEY_PIETERVDVN: ${{ secrets.DEPLOY_KEY_PIETERVDVN }}
|
|
||||||
run: |
|
|
||||||
cd pietervdvn.github.io
|
|
||||||
git pull
|
|
||||||
|
|
||||||
- name: get branch name
|
|
||||||
run: echo TARGET_BRANCH=${GITHUB_REF:11} >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: "Copying files"
|
|
||||||
run: |
|
|
||||||
echo "Deploying"
|
|
||||||
rm -rf pietervdvn.github.io/mc/${{ env.TARGET_BRANCH }}/*
|
|
||||||
mkdir -p pietervdvn.github.io/mc/${{ env.TARGET_BRANCH }}/
|
|
||||||
cp -r dist/* pietervdvn.github.io/mc/${{ env.TARGET_BRANCH }}/
|
|
||||||
cd pietervdvn.github.io/
|
|
||||||
git add *
|
|
||||||
if git status | grep -q "Changes to be committed"
|
|
||||||
then
|
|
||||||
git commit -am "Deploying a new version of mapcomplete"
|
|
||||||
git push
|
|
||||||
else
|
|
||||||
echo "No changes to commit"
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
TARGET_BRANCH: ${{ env.TARGET_BRANCH }}
|
|
||||||
|
|
||||||
- uses: mshick/add-pr-comment@v1
|
|
||||||
name: Comment the PR with the review URL
|
|
||||||
if: ${{ success() && github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/master' }}
|
|
||||||
with:
|
|
||||||
message: |
|
|
||||||
[🚀 Preview Branch](https://pietervdvn.github.io/mc/${{ env.TARGET_BRANCH }})
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
|
|
37
.github/workflows/validate_translations.yml
vendored
37
.github/workflows/validate_translations.yml
vendored
|
@ -1,37 +0,0 @@
|
||||||
name: Deployment on pietervdvn
|
|
||||||
on:
|
|
||||||
pull_request
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.actor == 'weblate' }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Set up Node.js
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "16"
|
|
||||||
cache: "npm"
|
|
||||||
cache-dependency-path: package-lock.json
|
|
||||||
|
|
||||||
- name: install deps
|
|
||||||
run: npm ci
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: create generated dir
|
|
||||||
run: mkdir ./assets/generated
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: sync translations
|
|
||||||
run: npm run generate:translations
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: generate layeroverview
|
|
||||||
run: npm run reset:layeroverview
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: run tests
|
|
||||||
run: npm run test
|
|
||||||
shell: bash
|
|
Loading…
Reference in a new issue