-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (45 loc) · 1.24 KB
/
build-and-push-image.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
name: Build and push images
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_call:
workflow_dispatch:
jobs:
build-n-push:
runs-on: ubuntu-latest
environment: production
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Docker Login
uses: docker/login-action@v2.0.0
with:
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- name: Setup pnpm
uses: pnpm/action-setup@v3.0.0
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Install depedencies
run: pnpm install
- name: Building deploy bundle
run: pnpm run build
env:
NUXT_PUBLIC_STUDIO_TOKENS: ${{ vars.NUXT_PUBLIC_STUDIO_TOKENS }}
NUXT_PUBLIC_SITE_URL: ${{ vars.NUXT_PUBLIC_SITE_URL }}
- name: Build the Docker image
run: docker build -t minhhikari/hikari-aniblog:latest .
- name: Push the "latest" image
run: docker push "minhhikari/hikari-aniblog:latest"
trigger-deployment:
needs: build-n-push
uses: ./.github/workflows/deploy-on-prod.yml
secrets: inherit