-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (47 loc) · 1.38 KB
/
build-and-deploy.yaml
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
on:
pull_request:
branches:
- dev
- src
push:
branches:
- dev
- src
name: build-and-deploy
jobs:
build-deploy:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GH_ACCESS }}
GITHUB_REPO: ${{ github.repository }} # This var replaces TRAVIS_REPO_SLUG
GITHUB_PULL_REQUEST: ${{ github.event.number }} # Replaces TRAVIS_PULL_REQUEST
HOME: ${{ github.workspace }}
steps:
- uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.14.3'
- name: Extract branch name on non pull request
if: github.event_name != 'pull_request'
shell: bash
run: echo "GITHUB_BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Extract branch name on pull requests
if: github.event_name == 'pull_request'
run: echo "GITHUB_BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
# Run Script
- name: Install Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.135.0'
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Run Build and deploy script
uses: nick-invision/retry@v2
with:
timeout_minutes: 3
max_attempts: 2
retry_on: timeout
command: bash -x 'build-and-deploy.sh'