-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.71 KB
/
publish-master.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
56
57
58
59
60
61
62
63
64
65
name: Publish app image
on:
push:
branches: [master]
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: write
discussions: read
packages: write
pull-requests: write
repository-projects: write
security-events: read
statuses: write
env:
IMAGE_REPO: ghcr.io/${{ github.repository }}
SERVICE_WEBHOOK_URL: https://portainer.isd.saenyakorn.dev/api/webhooks/47f2267b-30ad-4aff-8f3c-604e476d65a8
jobs:
publish-image:
strategy:
matrix:
node-version: [14.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Docker login using Github Token
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.IMAGE_REPO }}
tags: |
type=ref,event=branch
- name: Build and push to GitHub Packages
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.IMAGE_REPO }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE_REPO }}:buildcache,mode=max
context: .
- name: Trigger redeploy
run: curl -X POST ${{ env.SERVICE_WEBHOOK_URL}}