From ef1756df5ed001231cbd6808b16f459b66ef7d18 Mon Sep 17 00:00:00 2001 From: Freyja Odinthrir Date: Thu, 5 Sep 2024 21:46:21 -0700 Subject: [PATCH] Update blag version, improve workflow for new deployment host. --- .../production/build-deploy-docs.yml | 101 ++++++++++-------- Pipfile | 2 +- 2 files changed, 60 insertions(+), 43 deletions(-) diff --git a/.gitea/workflows/production/build-deploy-docs.yml b/.gitea/workflows/production/build-deploy-docs.yml index eca1856..2cf46f1 100644 --- a/.gitea/workflows/production/build-deploy-docs.yml +++ b/.gitea/workflows/production/build-deploy-docs.yml @@ -28,8 +28,8 @@ jobs: uses: docker/login-action@v3 with: registry: gitea.raer.me - username: ${{ secrets.PRODUCTION_REGISTRY_USERNAME }} - password: ${{ secrets.PRODUCTION_REGISTRY_TOKEN }} + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_TOKEN }} - name: Install required system packages... run: | @@ -40,8 +40,8 @@ jobs: - name: Install pipenv, build blog... env: - PIPENV_USER: ${{ secrets.PRODUCTION_REGISTRY_USERNAME }} - PIPENV_PASS: ${{ secrets.PRODUCTION_REGISTRY_TOKEN }} + PIPENV_USER: ${{ secrets.REGISTRY_USERNAME }} + PIPENV_PASS: ${{ secrets.REGISTRY_TOKEN }} run: | pip install pipenv pipenv install @@ -64,6 +64,9 @@ jobs: push: true platforms: linux/amd64 tags: gitea.raer.me/${{ gitea.repository }}:${{ gitea.ref_name }} +# It seems that the deploy stage here is the only thing that really needs changing. +## Further, changing this actually simplifies things. We no longer need this complex things that have been commented out below, instead, we do a much simpler process. The more complex process *should* be managed in a separate repo, anyway, because actually doing work on the machine that this is deployed to should be a more protected process. + job2: needs: job1 name: Connect to deployment host, update, and redeploy docs website. @@ -79,54 +82,68 @@ jobs: - name: Configure SSH... env: - SSH_USER: ${{ secrets.PRODUCTION_SSH_USER }} - SSH_KEY: ${{ secrets.PRODUCTION_SSH_KEY }} - SSH_HOST: ${{ secrets.PRODUCTION_SSH_HOST }} + SSH_USER: ${{ secrets.DEPLOYMENT_USER }} + SSH_KEY: ${{ secrets.DEPLOYMENT_KEY }} + SSH_HOST: ${{ secrets.DEPLOYMENT_HOST }} run: | mkdir -p ~/.ssh/ - echo "$SSH_KEY" > ~/.ssh/staging.key + echo "$DEPLOYMENT_KEY" > ~/.ssh/staging.key chmod 600 ~/.ssh/staging.key cat >> ~/.ssh/config <