-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.86 KB
/
on_release.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
55
56
57
58
59
60
61
62
63
64
65
name: 'Release'
on:
release:
types: [released]
permissions:
contents: read
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
build-release-and-publish:
name: 'Build and Publish Assets built for Releases'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: 'saashq'
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Set up wrench and build assets
run: |
npm install -g yarn
pip3 install -U saashq-wrench
wrench -v init saashq-wrench --no-procfile --no-backups --skip-assets --skip-redis-config-generation --python $(which python) --saashq-path $GITHUB_WORKSPACE/saashq
cd saashq-wrench && wrench build
- name: Package assets
run: |
mkdir -p $GITHUB_WORKSPACE/build
tar -cvpzf $GITHUB_WORKSPACE/build/assets.tar.gz ./saashq-wrench/sites/assets/saashq/dist
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.3.2
- name: Upload built Assets to Release
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: build/assets.tar.gz
asset_name: assets.tar.gz
asset_content_type: application/octet-stream
docker-release:
name: 'Trigger Docker build on release'
runs-on: ubuntu-latest
permissions:
contents: none
container:
image: alpine:latest
steps:
- name: curl
run: |
apk add curl bash
curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: Bearer ${{ secrets.CI_PAT }}" https://api.github.com/repos/saashq/saashq_docker/actions/workflows/build_stable.yml/dispatches -d '{"ref":"main"}'