-
Notifications
You must be signed in to change notification settings - Fork 282
46 lines (39 loc) · 1.04 KB
/
deploy.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
name: Deploy
on:
push:
branches:
- master
workflow_dispatch:
workflow_run:
workflows: [CI]
types:
- completed
env:
REGISTRY: ghcr.io
NX_AFFECTED: true
NX_AFFECTED_BASE: origin/master
jobs:
affected-deployment:
name: Build and publish affected images
runs-on: ubuntu-latest
permissions: 'write-all'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
with:
main-branch-name: 'master'
- name: Install dependencies
run: npm ci
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & Push Affected Images to Registry
id: deploy-images-to-registry
run: |
npx nx affected -t "push-image-to-registry" --repository=${{ github.repository }} --github-sha="$GITHUB_SHA"