Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

v1.0.0-beta.49

v1.0.0-beta.49 #61

Workflow file for this run

name: Publish to NPM and auto deploy to dependents
on:
release:
types:
- published
jobs:
deploy:
runs-on: ${{ matrix.os }}
env:
TERM: xterm
PRERELEASE_TAG: edge
strategy:
matrix:
os:
- ubuntu-20.04
node-version:
- '16'
# Install deps and cache
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
cache: yarn
- name: Install Yarn dependencies
run: yarn install --prefer-offline --frozen-lockfile
# Let's do tests rq just to make sure we dont push something that is fundamentally broken
- name: Lint code
run: yarn lint
- name: Run unit tests
run: yarn test
# Deploy to NPM
- name: Prepare release
uses: lando/prepare-release-action@v2
- name: Deploy release to npm
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_DEPLOY_TOKEN}}
run: |
if [ "${{ github.event.release.prerelease }}" == "false" ]; then
npm publish --access public --dry-run
npm publish --access public
echo "::notice title=Published ${{ github.ref_name }} to @${{ github.repository }}::This is a stable release published to the default 'latest' npm tag"
else
npm publish --access public --tag ${{ env.PRERELEASE_TAG }} --dry-run
npm publish --access public --tag ${{ env.PRERELEASE_TAG }}
echo "::notice title=Published ${{ github.ref_name }} to @${{ github.repository }}@${{ env.PRERELEASE_TAG }}::This is a pre-release published to the '${{ env.PRERELEASE_TAG }}' npm tag"
fi
auto-deploy:
runs-on: ${{ matrix.os }}
needs: deploy
env:
TERM: xterm
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
node-version:
- '16'
auto-deploy-repos:
- name: lando/acquia
dirs: ./
- name: lando/apache
dirs: ./
- name: lando/backdrop
dirs: ./
- name: lando/cli
dirs: ./
- name: lando/compose
dirs: ./
- name: lando/core
dirs: ./
- name: lando/core-next
dirs: ./
- name: lando/docs
dirs: ./
- name: lando/dotnet
dirs: ./
- name: lando/drupal
dirs: ./
- name: lando/elasticsearch
dirs: ./
- name: lando/go
dirs: ./
- name: lando/joomla
dirs: ./
- name: lando/lagoon
dirs: ./
- name: lando/lamp
dirs: ./
- name: lando/laravel
dirs: ./
- name: lando/lemp
dirs: ./
- name: lando/mailhog
dirs: ./
- name: lando/mariadb
dirs: ./
- name: lando/mean
dirs: ./
- name: lando/memcached
dirs: ./
- name: lando/mongo
dirs: ./
- name: lando/mssql
dirs: ./
- name: lando/mysql
dirs: ./
- name: lando/nginx
dirs: ./
- name: lando/node
dirs: ./
- name: lando/pantheon
dirs: ./
- name: lando/php
dirs: ./
- name: lando/phpmyadmin
dirs: ./
- name: lando/platformsh
dirs: ./
- name: lando/postgres
dirs: ./
- name: lando/python
dirs: ./
- name: lando/redis
dirs: ./
- name: lando/ruby
dirs: ./
- name: lando/symfony
dirs: ./
- name: lando/tomcat
dirs: ./
- name: lando/solr
dirs: ./
- name: lando/varnish
dirs: ./
- name: lando/wordpress
dirs: ./
steps:
# Install deps and cache
# NOTE that we use ref: main because we need to get the code that was updated from the prepare-release-action
- name: Checkout code
uses: actions/checkout@v3
with:
ref: main
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
cache: yarn
- name: Install Yarn dependencies
run: yarn install --prefer-offline --frozen-lockfile
# Auto deploy to everything else
- name: Auto deploy to ${{ matrix.auto-deploy-repos.name }}
uses: lando/auto-deploy-action@v2
with:
branch: main
slug: ${{ matrix.auto-deploy-repos.name }}
token: ${{ secrets.PIROG_TOKEN }}
pr: false
dirs: ${{ matrix.auto-deploy-repos.dirs }}
pr-deploy:
runs-on: ${{ matrix.os }}
needs: deploy
env:
TERM: xterm
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
node-version:
- '16'
pr-deploy-repos:
- name: lando/blog
dirs: ./
- name: lando/events
dirs: ./
- name: lando/website
dirs: ./
steps:
# Install deps and cache
# NOTE that we use ref: main because we need to get the code that was updated from the prepare-release-action
- name: Checkout code
uses: actions/checkout@v3
with:
ref: main
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
cache: yarn
- name: Install Yarn dependencies
run: yarn install --prefer-offline --frozen-lockfile
# Auto deploy to everything else
- name: PR deploy to ${{ matrix.auto-deploy-repos.name }}
uses: lando/auto-deploy-action@v2
with:
slug: ${{ matrix.pr-deploy-repos.name }}
token: ${{ secrets.PIROG_TOKEN }}
pr: true
dirs: ${{ matrix.pr-deploy-repos.dirs }}