Skip to content

Commit

Permalink
#61 Use railmapgen/releaser to deploy new version
Browse files Browse the repository at this point in the history
  • Loading branch information
wongchito committed Jan 4, 2024
1 parent 4e07629 commit e215958
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-tauri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
Expand Down
24 changes: 9 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Build and Release

on:
workflow_dispatch:
Expand Down Expand Up @@ -31,29 +31,23 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20'
- run: npm ci

- name: Build
id: build
run: ./scripts/build.sh
shell: bash
env:
BUMP_VERSION: ${{ github.event.inputs.bump_version }}
BUMP_VERSION: ${{ inputs.bump_version }}

- name: Upload artefacts
uses: railmapgen/upload-artefacts@main
- name: Release
if: ${{ inputs.auto_deploy == 'UAT' || inputs.auto_deploy == 'PRD' }}
uses: railmapgen/releaser@main
with:
app_name: railmapgen.github.io
version: ${{ steps.build.outputs.RMG_VER }}
environment: ${{ inputs.auto_deploy }}
dist: dist
token: ${{ secrets.RMG_BUILD_AND_RELEASE }}

- name: Auto deploy
if: ${{ github.event.inputs.auto_deploy == 'UAT' || github.event.inputs.auto_deploy == 'PRD' }}
run: |
curl -XPOST -u "wongchito:${{ secrets.RMG_BUILD_AND_RELEASE }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Content-Type: application/json" \
https://api.github.com/repos/uat-railmapgen/rmg-repositories/actions/workflows/release.yml/dispatches \
--data '{"ref": "main", "inputs": {"app_name": "railmapgen.github.io", "version": "${{ steps.build.outputs.RMG_VER }}", "environment": "${{ github.event.inputs.auto_deploy }}"}}'
github_token: ${{ secrets.RMG_BUILD_AND_RELEASE }}
gitlab_token: ${{ secrets.GITLAB_RELEASE }}
2 changes: 1 addition & 1 deletion .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
node-version: '20'
- run: npm ci
- name: Check
run: |
Expand Down

0 comments on commit e215958

Please sign in to comment.