Deploy website and publish package for release tags
This commit is contained in:
2
.github/workflows/deploy-preview.yml
vendored
2
.github/workflows/deploy-preview.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Deploy Preview
|
||||
name: Deploy Website (Preview)
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
|
||||
36
.github/workflows/deploy.yml
vendored
36
.github/workflows/deploy.yml
vendored
@@ -1,16 +1,18 @@
|
||||
name: Deploy
|
||||
name: Deploy Website
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
|
||||
concurrency:
|
||||
group: "deploy"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
deploy-branch:
|
||||
if: startsWith(github.ref, 'refs/heads/')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -35,3 +37,31 @@ jobs:
|
||||
git add .
|
||||
git commit -m "Website updates"
|
||||
git push origin main
|
||||
deploy-tag:
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Assert Latest Release
|
||||
run: node tasks/newest-tag.js --tag ${GITHUB_REF_NAME}
|
||||
- name: Build Website
|
||||
run: ./tasks/build-website.sh -l ${GITHUB_REF_NAME} -v ${GITHUB_REF_NAME}
|
||||
- name: Check out openlayers.github.io
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: openlayers/openlayers.github.io
|
||||
ssh-key: ${{ secrets.OPENLAYERS_GITHUB_IO_KEY }}
|
||||
path: openlayers.github.io
|
||||
- run: |
|
||||
cp -r build/site/* openlayers.github.io/dist/
|
||||
cd openlayers.github.io
|
||||
git config user.name "$(git --no-pager log --format=format:'%an' -n 1)"
|
||||
git config user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
|
||||
git add .
|
||||
git commit -m "Website updates"
|
||||
git push origin main
|
||||
|
||||
29
.github/workflows/publish.yml
vendored
29
.github/workflows/publish.yml
vendored
@@ -1,21 +1,24 @@
|
||||
name: Publish
|
||||
name: Publish Package
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
publish-npm:
|
||||
publish-branch:
|
||||
if: startsWith(github.ref, 'refs/heads/')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: '18'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
@@ -28,3 +31,23 @@ jobs:
|
||||
npm publish --tag dev
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||
publish-tag:
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Assert Latest Release
|
||||
run: node tasks/newest-tag.js --tag ${GITHUB_REF_NAME}
|
||||
- name: Publish
|
||||
run: |
|
||||
npm run build-package
|
||||
cd build/ol
|
||||
npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||
|
||||
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Release
|
||||
name: Create Release
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -16,6 +16,6 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Build Release Assets
|
||||
run: ./tasks/build-website.sh -l ${GITHUB_REF_NAME} -l ${GITHUB_REF_NAME}
|
||||
run: ./tasks/build-website.sh -l ${GITHUB_REF_NAME} -v ${GITHUB_REF_NAME}
|
||||
- name: Create Release
|
||||
run: node tasks/create-release.js --token ${{secrets.GITHUB_TOKEN}} --tag ${GITHUB_REF_NAME} --legacy build/${GITHUB_REF_NAME}-legacy.zip --site build/${GITHUB_REF_NAME}-site.zip
|
||||
|
||||
Reference in New Issue
Block a user