chore: test cicd #34
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: ci | |
on: | |
push: | |
branches: [main, develop] | |
workflow_dispatch: | |
jobs: | |
ci: | |
runs-on: sg | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Restore Cache | |
id: cache-node_modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.yaml') }} | |
- name: Install dependency | |
run: npm install | |
- name: List the state of node modules | |
if: ${{ steps.cache-node_modules.outputs.cache-hit != 'true' }} | |
continue-on-error: true | |
run: npm list | |
- name: Build | |
run: npm run build | |
- name: Archive file | |
uses: TheDoctor0/zip-release@0.7.1 | |
with: | |
filename: thq-${{ github.sha }}.zip | |
exclusions: '/*node_modules/*' | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: thq-${{ github.sha }}.zip | |
path: ./thq-${{ github.sha }}.zip | |
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' |