Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensures that deployment works rather than relying on "invisible" post-merge deployment. Destroys CI stack after run, retrying in case it's in an intermediate state. Unfortunately serverless doesn't support variables in the service name <serverless/serverless#9813>, so we can't have more than one CI environment deployed at any one time. Keep the DynamoDB table only in production.
- Loading branch information
Showing
6 changed files
with
203 additions
and
221 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.