Release types #112
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deno | |
on: | |
push: | |
tags: ["v*"] | |
pull_request: | |
branches: ["main"] | |
workflow_dispatch: | |
inputs: | |
perform_deploy: | |
type: boolean | |
required: true | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v4 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v1.1.4 | |
with: | |
deno-version: v1.x | |
- name: Verify formatting | |
run: deno fmt --check | |
- name: Run linter | |
run: deno lint | |
- name: Run type check | |
run: deno task check | |
- name: Run tests | |
run: deno test -A | |
deploy: | |
if: >- | |
vars.DEPLOY_ENABLED == 'true' && | |
contains(fromJSON(vars.DEPLOYERS), github.actor) && | |
(startsWith(github.ref, 'refs/tags/v') || inputs.perform_deploy) | |
runs-on: ubuntu-latest | |
needs: test | |
env: | |
WORK_DIR: harmony | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v4 | |
with: | |
path: ${{ env.WORK_DIR }} | |
- name: Deploy | |
uses: easingthemes/ssh-deploy@v5.0.3 | |
with: | |
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_KEY }} | |
ARGS: "-cilrvz --delete" | |
SOURCE: ${{ env.WORK_DIR }}/ | |
REMOTE_HOST: ${{ secrets.DEPLOY_HOST }} | |
REMOTE_PORT: ${{ secrets.DEPLOY_PORT || 22 }} | |
REMOTE_USER: ${{ secrets.DEPLOY_USER }} | |
TARGET: ${{ secrets.DEPLOY_TARGET }} | |
EXCLUDE: "/deno.lock, /.env, /snaps.db, /snaps/" | |
SCRIPT_BEFORE_REQUIRED: true | |
SCRIPT_BEFORE: | | |
set -e | |
ls -al "${{ secrets.DEPLOY_TARGET }}" | |
SCRIPT_AFTER_REQUIRED: true | |
SCRIPT_AFTER: | | |
set -e | |
ls -al "${{ secrets.DEPLOY_TARGET }}" | |
cd "${{ secrets.DEPLOY_TARGET }}" | |
deno task build | |
if [[ -n "${{ secrets.DEPLOY_SERVICE }}" ]]; then | |
systemctl --user restart "${{ secrets.DEPLOY_SERVICE }}" | |
fi |