Deploy workflow
1 changed files with 28 additions and 0 deletions
.gitea/workflows/deploy.yml ADDED
| @@ -0,0 +1,28 @@ | ||
| 1 | +name: deploy | |
| 2 | +on: | |
| 3 | + push: | |
| 4 | + branches: [main] | |
| 5 | + | |
| 6 | +jobs: | |
| 7 | + test: | |
| 8 | + runs-on: ubuntu-latest | |
| 9 | + container: php:7.4-cli | |
| 10 | + steps: | |
| 11 | + - uses: actions/checkout@v4 | |
| 12 | + - run: curl -sS https://getcomposer.org/installer | php && php composer.phar install -q | |
| 13 | + - run: vendor/bin/phpunit | |
| 14 | + | |
| 15 | + deploy: | |
| 16 | + needs: test | |
| 17 | + runs-on: ubuntu-latest | |
| 18 | + env: | |
| 19 | + GITEA_URL: https://git.glibcode.net | |
| 20 | + GITEA_TOKEN: aaad3b8d9de81995855d98e48d216d7b93c9d8fa | |
| 21 | + steps: | |
| 22 | + - name: Fetch the deploy scripts | |
| 23 | + run: | | |
| 24 | + git clone https://deploy-bot:${GITEA_TOKEN}@git.glibcode.net/glibcode-ops/deploy.git ops | |
| 25 | + - name: Deploy | |
| 26 | + run: ops/deploy.sh production | |
| 27 | + env: | |
| 28 | + SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }} | |