-
Notifications
You must be signed in to change notification settings - Fork 22
60 lines (59 loc) · 1.73 KB
/
production.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
50
51
52
53
54
55
56
57
58
59
60
name: server
on:
push:
branches:
- master
tags:
- "v*.*.*"
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Init Jiff
run: git submodule init jiff
- name: Update
run: git submodule update
- name: Install
run: npm ci
- name: Move into JIff dir
run: cd jiff && npm ci
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
name/app
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to Docker Hub
uses: docker/login-action@v2
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push Docker Build
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Push to Staging
uses: fjogeleit/http-request-action@v1
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
with:
method: "POST"
url: ${{ secrets.PORTAINER_WEBHOOK_PROD }}
preventFailureOnNoResponse: true