-
Notifications
You must be signed in to change notification settings - Fork 51
54 lines (54 loc) · 1.77 KB
/
upload.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Build upload
on:
push:
branches:
- main
- "3.*"
jobs:
upload-build:
if: github.repository_owner == 'canonical'
name: Upload build artifacts
runs-on: ubuntu-22.04
env:
PACKAGE_NAME: maas-ui-${{ github.sha }}.tar.gz
VITE_APP_GIT_SHA: ${{ github.sha }}
steps:
- uses: actions/checkout@v4
- name: Get branch name
uses: nelonoel/[email protected]
- name: Restore node_modules
id: yarn-cache
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: CYPRESS_INSTALL_BINARY=0 yarn install
- name: Build
run: VITE_APP_GIT_SHA=${{env.VITE_APP_GIT_SHA}} yarn build
env:
CI: false
- name: Compress
run: cd build && tar -czf ../${{env.PACKAGE_NAME}} ./ && ls -hs ../${{env.PACKAGE_NAME}}
- name: Install upload-assets snap
run: sudo snap install upload-assets
- name: Upload to assets server
run: upload-assets --url-path ${{env.PACKAGE_NAME}} ${{env.PACKAGE_NAME}}
env:
UPLOAD_ASSETS_API_TOKEN: ${{secrets.UPLOAD_ASSETS_API_TOKEN}}
- name: Create issue on failure
if: failure()
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
RUN_ID: ${{ github.run_id }}
WORKFLOW: ${{ github.workflow }}
with:
filename: .github/ISSUE_TEMPLATE/ci-failure.md
update_existing: true