-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (44 loc) · 1.43 KB
/
deploy-branches.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
# inside .github/workflows/action.yml
name: Deploy branch to DigitalOcean
on:
push:
branches-ignore:
- master
workflow_dispatch:
inputs:
debug_enabled:
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "15"
- name: Debug with tmate
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
- name: Install dependencies
run: yarn
- name: Build dist
run: yarn dist
- name: Check types
run: yarn types
- name: Get branch name
uses: nelonoel/[email protected]
- run: "echo branch is ${BRANCH_NAME}"
- name: Upload to DigitalOcean
uses: play-curious/do-space-sync-action@master
with:
args: --acl public-read
env:
SOURCE_DIR: ./dist/
DEST_DIR: ${{ env.BRANCH_NAME }}
SPACE_NAME: ${{ secrets.BRANCHES_SPACE_NAME }}
SPACE_REGION: ${{ secrets.SPACE_REGION }}
SPACE_ACCESS_KEY_ID: ${{ secrets.SPACE_ACCESS_KEY_ID }}
SPACE_SECRET_ACCESS_KEY: ${{ secrets.SPACE_SECRET_ACCESS_KEY }}