-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (63 loc) · 1.84 KB
/
pr.yml
File metadata and controls
70 lines (63 loc) · 1.84 KB
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
name: Check PR for GitHub Pages
on:
pull_request:
branches: [ master, dev ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Install dependencies
run: npm install
- name: Build
run: |
npm run lint
npm run build
- name: Prepare demo
run: |
cp -a dist/index.html dist/404.html
ls -al dist
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: dockerfiles
path: |
dist
nginx-default.conf
Dockerfile
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download docker files
uses: actions/download-artifact@v2
with:
name: dockerfiles
- name: Start deployment
uses: bobheadxi/deployments@master
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: pr-${{github.event.number}}
ref: ${{ github.head_ref }}
- name: Build and push Docker images
uses: docker/build-push-action@v1.1.1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: haopoboy/angular-material-starter
tag_with_ref: true
- name: Update deployment status
uses: bobheadxi/deployments@master
if: always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env_url: https://hub.docker.com/repository/docker/haopoboy/angular-material-starter/tags?name=pr-${{github.event.number}}