Skip to content

Merge branch 'main' into beta #937

Merge branch 'main' into beta

Merge branch 'main' into beta #937

Workflow file for this run

name: Release
on:
push:
branches:
- main
- alpha
- beta
jobs:
setup:
name: Set environment variables
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
DEPLOY_ENVIRONMENT: ${{ steps.env.outputs.DEPLOY_ENVIRONMENT }}
DEPLOY_SUBDOMAIN: ${{ steps.env.outputs.DEPLOY_SUBDOMAIN }}
steps:
- name: "鈽侊笍 compute environment variables"
id: env
run: |
echo "::set-output name=DEPLOY_ENVIRONMENT::$([[ ${{ github.ref_name }} == 'main' ]] && echo 'production' || echo ${{ github.ref_name }})"
echo "::set-output name=DEPLOY_SUBDOMAIN::$([[ ${{ github.ref_name }} == 'main' ]] && echo '' || echo '${{ github.ref_name }}.')"
test:
name: Unit Tests and Lint Checks
uses: open-sauced/hot/.github/workflows/development.yml@main
e2e:
name: E2E Tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "鈽侊笍 checkout repository"
uses: actions/checkout@v2
- name: "馃敡 setup node"
uses: actions/setup-node@v2.1.5
with:
node-version: 18
- name: "馃敡 install npm@latest"
run: npm i -g npm@latest
- name: "馃摝 install dependencies"
uses: bahmutov/npm-install@v1
- name: "馃攳 run tests"
run: npm run test:e2e --if-present
build:
name: Build application
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "鈽侊笍 checkout repository"
uses: actions/checkout@v2
- name: "馃敡 setup node"
uses: actions/setup-node@v2.1.5
with:
node-version: 18
- name: "馃敡 install npm@latest"
run: npm i -g npm@latest
- name: "馃摝 install dependencies"
uses: bahmutov/npm-install@v1
- name: "馃殌 static app"
run: npm run build
- name: "馃搨 production artifacts"
uses: actions/upload-artifact@v2
with:
name: build
path: .next
release:
environment:
name: ${{ needs.setup.outputs.DEPLOY_ENVIRONMENT }}
url: https://${{ needs.setup.outputs.DEPLOY_SUBDOMAIN }}app.opensauced.pizza
name: Semantic release
needs:
- setup
- test
- e2e
- build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.OS_GITHUB_APP_ID }}
private_key: ${{ secrets.OS_GITHUB_APP_PRIVATE_KEY }}
- name: "鈽侊笍 checkout repository"
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ steps.generate_token.outputs.token }}
- name: "馃搨 download build artifacts"
uses: actions/download-artifact@v2
with:
name: build
path: build
- name: "馃殌 release"
id: semantic-release
uses: open-sauced/release@v1
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
HUSKY: 0
cleanup:
name: Cleanup actions
needs:
- release
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "鈾伙笍 remove build artifacts"
uses: geekyeggo/delete-artifact@v1
with:
name: |
build