pulizia #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Production deployment | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
permissions: | |
contents: read | |
packages: write | |
uses: ./.github/workflows/build.yml | |
deployment: | |
runs-on: ubuntu-latest | |
environment: prod | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Copy docker compose | |
run: | |
cp ./deploy/docker-compose.yaml ./docker-compose.yaml | |
shell: bash | |
- name: copy files to target server via scp | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.DEPLOY_HOST }} | |
username: ${{ secrets.DEPLOY_USERNAME }} | |
port: 22 | |
key: ${{ secrets.DEPLOY_KEY }} | |
source: "./docker-compose.yaml" | |
target: "/var/gallery/" | |
- name: Run docker compose | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.DEPLOY_HOST }} | |
username: ${{ secrets.DEPLOY_USERNAME }} | |
key: ${{ secrets.DEPLOY_KEY }} | |
port: 22 | |
script: docker compose -f /var/gallery/docker-compose.yaml up -d |