ci: update deployment workflow (#21323)

This commit is contained in:
Turiiya 2024-04-21 22:12:30 +02:00 committed by GitHub
parent d9027df4b3
commit d7758372dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 46 additions and 17 deletions

View File

@ -1,28 +1,36 @@
name: VC gen name: VC gen
on: on:
push: pull_request:
branches:
- master
paths-ignore: paths-ignore:
- "**.vv" - '**.vv'
- "**.out" - '**.out'
- "**.yml" - '**.yml'
- "**.md" - '**.md'
- '!**/gen_vc_ci.yml' - '!**/gen_vc_ci.yml'
push:
paths-ignore:
- '**.vv'
- '**.out'
- '**.yml'
- '**.md'
- '!**/gen_vc_ci.yml'
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs: jobs:
build-vc: build-vc:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
env:
VREPO: github.com/vlang/vc.git
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Build V - name: Build V
run: make run: make -j4
- name: Regenerate v.c and v_win.c - name: Regenerate v.c and v_win.c
if: ${{ github.event.repository.full_name == 'vlang/v' }}
run: | run: |
git config --global user.email "vlang-bot@users.noreply.github.com" git config --global user.email "vlang-bot@users.noreply.github.com"
git config --global user.name "vlang-bot" git config --global user.name "vlang-bot"
@ -32,7 +40,7 @@ jobs:
rm -rf vc rm -rf vc
.github/workflows/retry.sh git clone --depth=1 \ .github/workflows/retry.sh git clone --depth=1 \
https://vlang-bot:${{ secrets.VLANG_BOT_SECRET }}@$VREPO https://vlang-bot:${{ secrets.VLANG_BOT_SECRET }}@github.com/vlang/vc.git
rm -rf vc/v.c vc/v_win.c rm -rf vc/v.c vc/v_win.c
@ -48,6 +56,11 @@ jobs:
git -C vc add v.c v_win.c git -C vc add v.c v_win.c
git -C vc commit -m "[v:master] $COMMIT_HASH - $COMMIT_MSG" git -C vc commit -m "[v:master] $COMMIT_HASH - $COMMIT_MSG"
# in case there are recent commits: # in case there are recent commits:
.github/workflows/retry.sh git -C vc pull --rebase origin master .github/workflows/retry.sh git -C vc pull --rebase origin master
git -C vc push || true git -C vc log -3
- name: Deploy
if: github.event.repository.full_name == 'vlang/v' && github.event_name == 'push' && github.event.ref == 'refs/heads/master'
run: git -C vc push || true

View File

@ -2,9 +2,25 @@ name: vlib modules CI
on: on:
pull_request: pull_request:
paths-ignore:
- '**.vv'
- '**.out'
- '**.yml'
- '**.md'
- '!**/module_docs_ci.yml'
push: push:
branches: paths-ignore:
- master - '**.vv'
- '**.out'
- '**.yml'
- '**.md'
- '!**/module_docs_ci.yml'
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs: jobs:
build-module-docs: build-module-docs:
@ -13,7 +29,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Build V - name: Build V
run: make run: make -j4
- name: Test v doc - name: Test v doc
run: | run: |
# While the integration tests (executing the v doc command) should install # While the integration tests (executing the v doc command) should install
@ -23,5 +39,5 @@ jobs:
- name: Build module documentation - name: Build module documentation
run: ./v doc -m -f html vlib/ run: ./v doc -m -f html vlib/
- name: Deploy docs to vercel - name: Deploy docs to vercel
if: ${{ github.event.repository.full_name == 'vlang/v' }} if: github.event.repository.full_name == 'vlang/v' && github.event_name == 'push' && github.event.ref == 'refs/heads/master'
run: npx vercel --confirm --prod --name vmodules --token ${{ secrets.VERCEL_TOKEN }} vlib/_docs/ || true run: npx vercel --confirm --prod --name vmodules --token ${{ secrets.VERCEL_TOKEN }} vlib/_docs/ || true