From 123a0904914077372b7b79a34128308ac164112b Mon Sep 17 00:00:00 2001 From: Bryan Joshua Pedini Date: Wed, 21 Aug 2024 22:02:01 +0200 Subject: [PATCH] added automatic deploy workflow with Gitea CI Actions --- .gitea/workflows/deploy.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .gitea/workflows/deploy.yaml diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..7c066bd --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,27 @@ +--- +name: Deploy website on production server when committing on main +concurrency: 1 + +on: + push: + branches: + - main + +defaults: + run: + shell: bash + +jobs: + test: + runs-on: ubuntu-latest + steps: + - run: echo "${{ secrets.SSH_PRIVATE_KEY }}" > /private.key + - run: chmod 600 /private.key + - uses: actions/checkout@v4 + - run: APP_VERSION=latest make + - run: | + SSH_PRIVATE_KEY=/private.key + SSH_USERNAME=${{ secrets.SSH_USERNAME }} + DEPLOYMENT_HOST=${{ secrets.DEPLOYMENT_HOST }} + DEPLOYMENT_PATH=${{ secrets.DEPLOYMENT_PATH }} + make deploy