Aircraft Updates #16
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: 'Build' | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
artifacts: | |
name: 'Create release' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install node | |
uses: actions/setup-node@v3 | |
with: | |
cache: 'npm' | |
- name: build | |
run: | | |
npm install | |
npm run build | |
# Create a zip from what's in this repo | |
- name: Archive Release | |
uses: thedoctor0/[email protected] | |
with: | |
type: 'zip' | |
directory: './dist' | |
path: '.' | |
filename: '../stable.zip' | |
exclusions: '' | |
# List all the files that have been created | |
- name: 'List files' | |
run: | | |
find dist/ -maxdepth 2 -type f | |
- name: Upload artifact for deployment job | |
uses: actions/upload-artifact@v3 | |
with: | |
name: acars-package | |
path: 'stable.zip' | |
# | |
# Now publish it up | |
# | |
publish: | |
runs-on: ubuntu-latest | |
needs: [ 'artifacts' ] | |
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v3 | |
with: | |
name: acars-package | |
- uses: BetaHuhn/do-spaces-action@latest | |
with: | |
access_key: ${{ secrets.SPACE_ACCESS_KEY}} | |
secret_key: ${{ secrets.SPACE_SECRET_KEY }} | |
space_name: ${{ secrets.SPACE_NAME }} | |
space_region: ${{ secrets.SPACE_REGION }} | |
cdn_domain: ${{ secrets.SPACE_CDN_DOMAIN }} | |
source: stable.zip | |
out_dir: scripts |