refactor: trigger fe cd #2
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: Frontend Deploy | |
on: | |
push: | |
branches: | |
- dev | |
paths: | |
- frontend/** | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: prod | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Nodejs 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "npm" | |
- name: Install modules | |
working-directory: ./frontend | |
run: npm ci | |
- name: Build | |
working-directory: ./frontend | |
run: npm run build | |
- name: Copy docker compose | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
source: docker-compose.yaml | |
target: ~/${ GITHUB_REPOSITORY##*/ } | |
- name: Copy dist | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
source: frontend/dist/ | |
target: ~/${ GITHUB_REPOSITORY##*/ } | |
# - name: Restart docker compose | |
# uses: appleboy/[email protected] | |
# with: | |
# host: ${{ secrets.HOST }} | |
# username: ${{ secrets.USERNAME }} | |
# key: ${{ secrets.KEY }} | |
# script: | | |
# cd ~/${ GITHUB_REPOSITORY##*/ } | |
# docker compose restart fe |