Skip to content

Update production.yml #43

Update production.yml

Update production.yml #43

Workflow file for this run

name: CI/CD
on:
push:
branches:
- master
workflow_dispatch:
env:
URL_DEV: loganmarchione.github.io
URL_PRD: loganmarchione.com
jobs:
deploy-development:
uses: ./.github/workflows/development.yml

Check failure on line 15 in .github/workflows/production.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/production.yml

Invalid workflow file

error parsing called workflow ".github/workflows/production.yml" -> "./.github/workflows/development.yml" (source branch with sha:6a24d62415895c63e8deee04ce71c579dbc22528) : workflow is not reusable as it is missing a `on.workflow_call` trigger
secrets: inherit
deploy-production:
name: Deploy (loganmarchione.com)
needs: deploy-development
runs-on: ubuntu-latest
steps:
- name: Check out the codebase
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.18'
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
extended: true
- name: Build
run: hugo --gc --baseURL="https://${{ env.URL_PRD }}"
- name: SSH setup
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/deploy_key
ssh-keyscan -p ${{ secrets.DEPLOY_PORT }} ${{ env.URL_PRD }} > ~/.ssh/known_hosts
chmod -R 700 ~/.ssh
chmod 600 ~/.ssh/deploy_key
- name: Rsync
run: |
rsync -rltvz --delete --omit-dir-times \
-e "ssh -i ~/.ssh/deploy_key -p ${{ secrets.DEPLOY_PORT }}" public/ \
${{ secrets.DEPLOY_USER }}@${{ env.URL_PRD }}:/var/www/${{ env.URL_PRD }}