-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (79 loc) · 2.95 KB
/
deploy-production.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Deploy production instance
on:
push:
branches:
- master
jobs:
deploy:
if: startsWith(github.ref, 'refs/tags/v')
concurrency:
group: ${{ github.workflow }}
runs-on: ubuntu-22.04
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Get Python version
run: echo "PYTHON_VERSION=$(cat .python-version)" >> "$GITHUB_ENV"
- name: Use Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Cache pip
uses: actions/cache@v3.2.6
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ secrets.CACHE_SEED }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('./poetry.lock') }}
restore-keys: ${{ runner.os }}-pip-${{ secrets.CACHE_SEED }}-${{ env.PYTHON_VERSION }}-
- name: Build project
run: |
echo ${{ github.repository }}
zip -r qgis-plugin-repository.zip .
- name: Create Release
id: create_release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
See [CHANGELOG](https://github.com/linz/qgis-plugin-repository/blob/master/CHANGELOG.md) for detailed release information.
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./qgis-plugin-repository.zip
asset_name: qgis-plugin-repository
asset_content_type: application/zip
- name: Configure AWS Prd Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-2
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME_PRD }}
- name: Get Node.js version
run: echo "NODE_VERSION=$(cat .nvmrc)" >> "$GITHUB_ENV"
- name: Install Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache Node.js packages
uses: actions/cache@v3.2.6
with:
path: ~/.npm
key:
${{ runner.os }}-node-${{ secrets.CACHE_SEED }}-${{ hashFiles('./package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ secrets.CACHE_SEED }}-
- name: install serverless
run: npm install
- name: deploy app
run: npx serverless deploy --stage=dev --param=resource-suffix=56c159c6dfdsw2378fec41dfd