Add movies hub project #60
Workflow file for this run
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 | |
on: | |
pull_request: | |
types: ['opened', 'edited', 'synchronize', 'closed'] | |
branches: ['main'] | |
jobs: | |
build: | |
name: Build Project | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Archive build artifacts | |
run: tar -czf build.tar.gz dist | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-dist | |
path: build.tar.gz | |
copy: | |
name: Archive and Copy | |
if: github.event_name == 'pull_request' && github.event.action == 'closed' | |
needs: build | |
runs-on: self-hosted | |
environment: production | |
steps: | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-dist | |
path: . | |
- name: Extract build artifacts | |
run: tar -xzf build.tar.gz | |
- name: Copy folder to where nginx expects it to be | |
run: cp -r dist/* ${{secrets.COPY_TO_FOLDER}} |