-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (37 loc) · 1.21 KB
/
deploy-test.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
name: Deploy to TEST environment
on:
pull_request:
types: [opened, reopened, ready_for_review, synchronize]
jobs:
build-docker:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout the updated source code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image and push it to the container registry
uses: docker/build-push-action@v4
with:
build-args: NG_CONFIGURATION=test
push: true
context: .
tags: "ghcr.io/bosancz/web:test"
cache-from: type=gha
cache-to: type=gha,mode=max
deploy:
needs: build
runs-on: ubuntu-latest # Run the job on an Ubuntu runner
steps:
- name: Call Watchtower to Update Docker Image
run: |
curl -X POST "${{ env.WATCHTOWER_URL }}" \
-H "Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}" \
-H "Content-Type: application/json"