Skip to content

Deploy

Deploy #51

Workflow file for this run

name: Deploy
on:
workflow_dispatch
concurrency:
group: "deploy"
cancel-in-progress: true
permissions:
contents: write # Required for creating releases
jobs:
build:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Load deploy key
run: |
mkdir ~/.ssh
echo "${{ secrets.CONFIG }}" > ~/.ssh/config
echo "${{ secrets.KNOWN_HOSTS }}" > ~/.ssh/known_hosts
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: Clean slate
run: ssh server 'rm -fr tudo_server'
- name: Checkout
run: ssh server 'git clone git@github.com:cachapa/tudo_server.git'
- name: Get dependencies
run: ssh server '/opt/dart-sdk/bin/dart pub get -C tudo_server'
- name: Build binary
run: ssh server '/opt/dart-sdk/bin/dart compile exe tudo_server/bin/main.dart -o tudo-server.new'
- name: Stop service
run: ssh server 'systemctl --user stop tudo'
- name: Replace binary
run: ssh server 'mv tudo-server.new tudo-server'
- name: Start service
run: ssh server 'systemctl --user start tudo'
- name: Cleanup
run: ssh server 'rm -fr tudo_server'
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ github.run_number }}"
release_name: "v${{ github.run_number }}"
Docker:

Check failure on line 53 in .github/workflows/deploy.yml

View workflow run for this annotation

GitHub Actions / Deploy

Invalid workflow file

The workflow is not valid. .github/workflows/deploy.yml (Line: 53, Col: 3): Error calling workflow 'cachapa/tudo_server/.github/workflows/docker.yml@dd95b90f8d88e91932ccca6367e4b5b221c0fab6'. The workflow is requesting 'packages: write', but is only allowed 'packages: none'.
uses: ./.github/workflows/docker.yml
needs: build
with:
version: "v${{ github.run_number }}"